Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions test/integration/httproute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -648,13 +648,18 @@ func TestHTTPRouteFilterHosts(t *testing.T) {
require.Error(t, testGetByHost(t, "another2.specific.io"))

t.Logf("update hostname in httproute to an unmatched host")
httpRoute, err = hClient.Get(ctx, httpRoute.Name, metav1.GetOptions{})
require.NoError(t, err)
httpRoute.Spec.Hostnames = []gatewayapi.Hostname{
gatewayapi.Hostname("another.specific.io"),
}
httpRoute, err = hClient.Update(ctx, httpRoute, metav1.UpdateOptions{})
require.NoError(t, err)
require.EventuallyWithT(t, func(c *assert.CollectT) {
httpRoute, err = hClient.Get(ctx, httpRoute.Name, metav1.GetOptions{})
if !assert.NoErrorf(t, err, "failed getting the HTTPRoute %s", httpRoute.Name) {
return
}
httpRoute.Spec.Hostnames = []gatewayapi.Hostname{
gatewayapi.Hostname("another.specific.io"),
}
httpRoute, err = hClient.Update(ctx, httpRoute, metav1.UpdateOptions{})
assert.NoErrorf(c, err, "failed updating the HTTPRoute %s", httpRoute.Name)
}, test.RequestTimeout, 100*time.Millisecond)

t.Logf("status of httproute should contain an 'Accepted' condition with 'False' status")
require.EventuallyWithT(t, func(c *assert.CollectT) {
currentHTTPRoute, err := hClient.Get(ctx, httpRoute.Name, metav1.GetOptions{})
Expand Down
Loading