X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FContainerUtils.py;h=b552e4d9e63387b095c7ce0f2fb70f4688c9324b;hb=20cc67d5f23a7f4e05b08012bf3d3a63be4bcf63;hp=b02033eeb9a24a32e364e5ce5dbb65997b4dcb7d;hpb=f6a8c61f15deb7906d2caae10fea702235123954;p=csit.git diff --git a/resources/libraries/python/ContainerUtils.py b/resources/libraries/python/ContainerUtils.py index b02033eeb9..b552e4d9e6 100644 --- a/resources/libraries/python/ContainerUtils.py +++ b/resources/libraries/python/ContainerUtils.py @@ -27,7 +27,7 @@ from resources.libraries.python.VppConfigGenerator import VppConfigGenerator __all__ = ["ContainerManager", "ContainerEngine", "LXC", "Docker", "Container"] -SUPERVISOR_CONF = '/etc/supervisord.conf' +SUPERVISOR_CONF = '/etc/supervisor/supervisord.conf' class ContainerManager(object): @@ -397,37 +397,37 @@ class ContainerEngine(object): if isinstance(self, LXC): self.execute('sleep 3; apt-get update') self.execute('apt-get install -y supervisor') - self.execute('echo "{config}" > {config_file} && ' - 'supervisord -c {config_file}'. - format( - config='[unix_http_server]\n' - 'file = /tmp/supervisor.sock\n\n' - '[rpcinterface:supervisor]\n' - 'supervisor.rpcinterface_factory = ' - 'supervisor.rpcinterface:make_main_rpcinterface\n\n' - '[supervisorctl]\n' - 'serverurl = unix:///tmp/supervisor.sock\n\n' - '[supervisord]\n' - 'pidfile = /tmp/supervisord.pid\n' - 'identifier = supervisor\n' - 'directory = /tmp\n' - 'logfile=/tmp/supervisord.log\n' - 'loglevel=debug\n' - 'nodaemon=false\n\n', - config_file=SUPERVISOR_CONF)) + self.execute('echo "{config}" > {config_file} && ' + 'supervisord -c {config_file}'. + format( + config='[unix_http_server]\n' + 'file = /tmp/supervisor.sock\n\n' + '[rpcinterface:supervisor]\n' + 'supervisor.rpcinterface_factory = supervisor.' + 'rpcinterface:make_main_rpcinterface\n\n' + '[supervisorctl]\n' + 'serverurl = unix:///tmp/supervisor.sock\n\n' + '[supervisord]\n' + 'pidfile = /tmp/supervisord.pid\n' + 'identifier = supervisor\n' + 'directory = /tmp\n' + 'logfile = /tmp/supervisord.log\n' + 'loglevel = debug\n' + 'nodaemon = false\n\n', + config_file=SUPERVISOR_CONF)) def start_vpp(self): """Start VPP inside a container.""" - self.execute('echo "{config}" >> {config_file}'. + self.execute('echo "{config}" >> {config_file} && ' + 'supervisorctl reload'. format( config='[program:vpp]\n' - 'command=/usr/bin/vpp -c /etc/vpp/startup.conf\n' - 'autostart=false\n' - 'autorestart=false\n' - 'redirect_stderr=true\n' - 'priority=1', + 'command = /usr/bin/vpp -c /etc/vpp/startup.conf\n' + 'autostart = false\n' + 'autorestart = false\n' + 'redirect_stderr = true\n' + 'priority = 1', config_file=SUPERVISOR_CONF)) - self.execute('supervisorctl reload') self.execute('supervisorctl start vpp') from robot.libraries.BuiltIn import BuiltIn @@ -651,6 +651,8 @@ class LXC(ContainerEngine): '{options} 0 0'.format( host_dir=host_dir, guest_dir=guest_dir[1:], options=options) + self.container.ssh.exec_command_sudo( + "sh -c 'mkdir -p {host_dir}'".format(host_dir=host_dir)) ret, _, _ = self.container.ssh.exec_command_sudo( "sh -c 'echo \"{e}\" >> /var/lib/lxc/{c.name}/config'". format(e=entry, c=self.container))