Fix bash cmd used in scenario trunk tests

In scenario trunk test test_subport_connectivity there
is bash command used to check name of base interface on
spawned vm (e.g. ens3 or eth0), configure vlan interface
with vlan_id used on trunk port (e.g. ens3.10),
make this vlan device up and run dhclient on this interface
if it's not running yet.

This command was broken and that cause failure of this test.

Change-Id: I4c0207f79cd6df2594f976b9509697209011edf2
Closes-Bug: #1766701
(cherry picked from commit 6bf840f0a73579804375dddd92b3a20acc57b877)
This commit is contained in:
Slawek Kaplonski 2018-09-12 02:01:31 +02:00
parent 8be878808e
commit c78b80becf
1 changed files with 5 additions and 6 deletions

View File

@ -30,12 +30,11 @@ LOG = logging.getLogger(__name__)
CONF = config.CONF
CONFIGURE_VLAN_INTERFACE_COMMANDS = (
'IFACE=$(PATH=$PATH:/usr/sbin ip l | grep "^[0-9]*: e" |'
'cut -d \: -f 2) && '
'sudo su -c '
'"ip l a link $IFACE name $IFACE.%(tag)d type vlan id %(tag)d &&'
'ip l s up dev $IFACE.%(tag)d && '
'dhclient $IFACE.%(tag)d"')
'IFACE=$(PATH=$PATH:/usr/sbin ip l | grep "^[0-9]*: e"|cut -d \: -f 2) &&'
'sudo ip l a link $IFACE name $IFACE.%(tag)d type vlan id %(tag)d &&'
'sudo ip l s up dev $IFACE.%(tag)d && '
'ps -ef | grep -q "[d]hclient .*$IFACE.%(tag)d" || '
'sudo dhclient $IFACE.%(tag)d;')
def get_next_subnet(cidr):