From 11fb404e06c63f0bbc7e871302c1f577c8063a91 Mon Sep 17 00:00:00 2001 From: Frode Nordahl Date: Tue, 28 Sep 2021 17:53:15 +0200 Subject: [PATCH] test: Fix options:requested-chassis with hostname This test currently passes, but is broken in two ways. 1) The `fetch_column` helper should be used to retrieve the value of hostname, not `fetch` wich results in a "fetch: command not found" error which is currently not caught by the test. As a consequence the requested-chassis option was set to the empty string ("") and not the chassis hostname. 2) When we introduced testing with TLS+RBAC in c948d6bb05b4 the ovn_az_attach helper was updated to set the hostname to match system-id. This of course also makes the name and hostname columns in the Chassis record contain the same value which made this test no longer do what it says on the tin. Update test to explicitly set the value to be used for requested-chassis option in the Chassis hostname record, and add a check for it not being empty nor equal to chassis name. Fixes: 4afe409e95c7 ("tests: Introduce new testing helpers.") Fixes: c948d6bb05b4 ("tests: Test with SSL and RBAC for controller by default") Signed-off-by: Frode Nordahl Signed-off-by: Numan Siddique (cherry picked from commit 9dadbd482cc09b86a81e72887f8ce7849f70b2af) --- tests/ovn.at | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/ovn.at b/tests/ovn.at index fbc5952060..49ece87358 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -13535,13 +13535,15 @@ ovn-nbctl lsp-add ls0 lsp0 net_add n1 sim_add hv1 as hv1 +ovs-vsctl set Open_vSwitch . external-ids:hostname=hv1-hostname ovs-vsctl add-br br-phys ovn_attach n1 br-phys 192.168.0.11 ovs-vsctl -- add-port br-int hv1-vif0 -- set Interface hv1-vif0 ofport-request=1 wait_row_count Chassis 1 name=hv1 -hv1_hostname=$(fetch Chassis hostname name=hv1) +hv1_hostname=$(fetch_column Chassis hostname name=hv1) echo "hv1_hostname=${hv1_hostname}" +AT_CHECK([test -n "${hv1_hostname}" -a "${hv1_hostname}" != hv1], [1], []) check ovn-nbctl --wait=hv lsp-set-options lsp0 requested-chassis=${hv1_hostname} as hv1 ovs-vsctl set interface hv1-vif0 external-ids:iface-id=lsp0