[vs-test]: support python docker 3.5.0 (#1958)
* [vs-test]: support python docker 3.5.0 Signed-off-by: Guohan Lu <gulv@microsoft.com>
This commit is contained in:
parent
788b20ee12
commit
a01791ebcd
@ -22,11 +22,11 @@ def test_InvalidNexthop(dvs):
|
|||||||
|
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
||||||
output = dvs.runcmd(["vtysh", "-c", "show ipv6 bgp"])
|
(exit_code, output) = dvs.runcmd(["vtysh", "-c", "show ipv6 bgp"])
|
||||||
|
|
||||||
p.terminate()
|
p.terminate()
|
||||||
p = p.wait()
|
p = p.wait()
|
||||||
|
|
||||||
print output
|
print exit_code, output
|
||||||
|
|
||||||
assert "3333::/64" in output
|
assert "3333::/64" in output
|
||||||
|
@ -27,9 +27,9 @@ def test_bounce(dvs):
|
|||||||
|
|
||||||
time.sleep(60)
|
time.sleep(60)
|
||||||
|
|
||||||
sum_res = dvs.runcmd(["vtysh", "-c", "show ip bgp sum"])
|
(exit_code, sum_res) = dvs.runcmd(["vtysh", "-c", "show ip bgp sum"])
|
||||||
all_route = dvs.runcmd(["vtysh", "-c", "show ip bgp"])
|
(exit_code, all_route) = dvs.runcmd(["vtysh", "-c", "show ip bgp"])
|
||||||
announce_route = dvs.runcmd(["vtysh", "-c", "show ip bgp neighbors 10.0.0.3 advertised-routes"])
|
(exit_code, announce_route) = dvs.runcmd(["vtysh", "-c", "show ip bgp neighbors 10.0.0.3 advertised-routes"])
|
||||||
|
|
||||||
p1.terminate()
|
p1.terminate()
|
||||||
p1 = p1.wait()
|
p1 = p1.wait()
|
||||||
|
@ -55,20 +55,7 @@ class AsicDbValidator(object):
|
|||||||
keys = atbl.getKeys()
|
keys = atbl.getKeys()
|
||||||
|
|
||||||
assert len(keys) >= 1
|
assert len(keys) >= 1
|
||||||
# Filter out DTel Acl tables
|
self.default_acl_tables = keys
|
||||||
default_table_found = False
|
|
||||||
for k in keys:
|
|
||||||
if default_table_found:
|
|
||||||
break
|
|
||||||
(status, fvs) = atbl.get(k)
|
|
||||||
for item in fvs:
|
|
||||||
if item[0] == "SAI_ACL_TABLE_ATTR_ACL_BIND_POINT_TYPE_LIST":
|
|
||||||
if 'SAI_ACL_BIND_POINT_TYPE_PORT' in item[1]:
|
|
||||||
self.default_acl_table = k
|
|
||||||
default_table_found = True
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
break
|
|
||||||
|
|
||||||
atbl = swsscommon.Table(self.adb, "ASIC_STATE:SAI_OBJECT_TYPE_ACL_ENTRY")
|
atbl = swsscommon.Table(self.adb, "ASIC_STATE:SAI_OBJECT_TYPE_ACL_ENTRY")
|
||||||
keys = atbl.getKeys()
|
keys = atbl.getKeys()
|
||||||
@ -179,9 +166,13 @@ class DockerVirtualSwitch(object):
|
|||||||
network_mode="container:%s" % self.ctn_sw.name,
|
network_mode="container:%s" % self.ctn_sw.name,
|
||||||
volumes={ self.mount: { 'bind': '/var/run/redis', 'mode': 'rw' } })
|
volumes={ self.mount: { 'bind': '/var/run/redis', 'mode': 'rw' } })
|
||||||
|
|
||||||
self.ctn.exec_run("sysctl -w net.ipv6.conf.all.disable_ipv6=0")
|
try:
|
||||||
self.check_ready()
|
self.ctn.exec_run("sysctl -w net.ipv6.conf.all.disable_ipv6=0")
|
||||||
self.init_asicdb_validator()
|
self.check_ready()
|
||||||
|
self.init_asicdb_validator()
|
||||||
|
except:
|
||||||
|
self.destroy()
|
||||||
|
raise
|
||||||
|
|
||||||
def destroy(self):
|
def destroy(self):
|
||||||
if self.cleanup:
|
if self.cleanup:
|
||||||
@ -199,7 +190,11 @@ class DockerVirtualSwitch(object):
|
|||||||
started = 0
|
started = 0
|
||||||
while True:
|
while True:
|
||||||
# get process status
|
# get process status
|
||||||
out = self.ctn.exec_run("supervisorctl status")
|
res = self.ctn.exec_run("supervisorctl status")
|
||||||
|
try:
|
||||||
|
out = res.output
|
||||||
|
except AttributeError:
|
||||||
|
out = res
|
||||||
for l in out.split('\n'):
|
for l in out.split('\n'):
|
||||||
fds = re_space.split(l)
|
fds = re_space.split(l)
|
||||||
if len(fds) < 2:
|
if len(fds) < 2:
|
||||||
@ -231,7 +226,14 @@ class DockerVirtualSwitch(object):
|
|||||||
self.asicdb = AsicDbValidator(self)
|
self.asicdb = AsicDbValidator(self)
|
||||||
|
|
||||||
def runcmd(self, cmd):
|
def runcmd(self, cmd):
|
||||||
return self.ctn.exec_run(cmd)
|
res = self.ctn.exec_run(cmd)
|
||||||
|
try:
|
||||||
|
exitcode = res.exit_code
|
||||||
|
out = res.output
|
||||||
|
except AttributeError:
|
||||||
|
exitcode = 0
|
||||||
|
out = res
|
||||||
|
return (exitcode, out)
|
||||||
|
|
||||||
def copy_file(self, path, filename):
|
def copy_file(self, path, filename):
|
||||||
tarstr = StringIO.StringIO()
|
tarstr = StringIO.StringIO()
|
||||||
|
Reference in New Issue
Block a user