- 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))
-
- def install_vpp(self):
- """Install VPP inside a container."""
- self.execute('ln -s /dev/null /etc/sysctl.d/80-vpp.conf')
- # Workaround for install xenial vpp build on bionic ubuntu.
- self.execute('apt-get install -y wget')
- self.execute('deb=$(mktemp) && wget -O "${deb}" '
- 'http://launchpadlibrarian.net/336117627/'
- 'libmbedcrypto0_2.5.1-1ubuntu1_amd64.deb && '
- 'dpkg -i "${deb}" && '
- 'rm -f "${deb}"')
- self.execute('deb=$(mktemp) && wget -O "${deb}" '
- 'http://launchpadlibrarian.net/252876048/'
- 'libboost-system1.58.0_1.58.0+dfsg-5ubuntu3_amd64.deb && '
- 'dpkg -i "${deb}" && '
- 'rm -f "${deb}"')
- self.execute(
- 'dpkg -i --force-all '
- '{guest_dir}/openvpp-testing/download_dir/*.deb'.
- format(guest_dir=self.container.mnt[0].split(':')[1]))
- self.execute('apt-get -f install -y')
- self.execute('apt-get install -y ca-certificates')
- self.execute('echo "{config}" >> {config_file}'.
+ 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))
+
+ def start_vpp(self):
+ """Start VPP inside a container."""
+ self.execute('echo "{config}" >> {config_file} && '
+ 'supervisorctl reload'.