Skip to content

Commit

Permalink
test: Fix options:requested-chassis with hostname
Browse files Browse the repository at this point in the history
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 c948d6b 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: 4afe409 ("tests: Introduce new testing helpers.")
Fixes: c948d6b ("tests: Test with SSL and RBAC for controller by default")
Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
(cherry picked from commit 9dadbd4)
  • Loading branch information
fnordahl authored and numansiddique committed Oct 5, 2021
1 parent dd1b4b4 commit 11fb404
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/ovn.at
Expand Up @@ -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

Expand Down

0 comments on commit 11fb404

Please sign in to comment.