Skip to content

Commit

Permalink
use unique directory to mount redis.sock
Browse files Browse the repository at this point in the history
Signed-off-by: Guohan Lu <gulv@microsoft.com>
  • Loading branch information
lguohan committed Oct 22, 2018
1 parent 7d1b09e commit 9290950
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ def __init__(self, name=None, keeptb=False):
self.rtd = ['fpmsyncd', 'zebra']
self.teamd = ['teamsyncd', 'teammgrd']
self.alld = self.basicd + self.swssd + self.syncd + self.rtd + self.teamd
self.mount = "/var/run/redis-vs"
self.redis_sock = self.mount + '/' + "redis.sock"
self.client = docker.from_env()

self.ctn = None
Expand Down Expand Up @@ -191,6 +189,11 @@ def __init__(self, name=None, keeptb=False):
server = VirtualServer(self.ctn_sw.name, self.ctn_sw_pid, i)
self.servers.append(server)

# mount redis to base to unique directory
self.mount = "/var/run/redis-vs/{}".format(self.ctn_sw.name)
os.system("mkdir -p {}".format(self.mount))
self.redis_sock = self.mount + '/' + "redis.sock"

# create virtual switch container
self.ctn = self.client.containers.run('docker-sonic-vs', privileged=True, detach=True,
network_mode="container:%s" % self.ctn_sw.name,
Expand All @@ -215,6 +218,7 @@ def destroy(self):
if self.cleanup:
self.ctn.remove(force=True)
self.ctn_sw.remove(force=True)
os.system("rm -rf {}".format(self.mount))
for s in self.servers:
s.destroy()

Expand Down

0 comments on commit 9290950

Please sign in to comment.