Edit subprocess command in updater.py

... to use 'python -m tuf.scripts.simple_server' which works on Linux, MacOS, and Windows

Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
This commit is contained in:
Vladimir Diaz 2018-04-17 14:57:18 -04:00
parent 8defb4ac0a
commit 613d079181
No known key found for this signature in database
GPG key ID: 5DEE9B97B0E2289A

View file

@ -98,7 +98,7 @@ def setUpClass(cls):
# as a delegated role 'targets/role1', three target files, five key files,
# etc.
cls.SERVER_PORT = random.randint(30000, 45000)
command = ['python', 'simple_server.py', str(cls.SERVER_PORT)]
command = ['python', '-m', 'tuf.scripts.simple_server', str(cls.SERVER_PORT)]
cls.server_process = subprocess.Popen(command, stderr=subprocess.PIPE)
logger.info('\n\tServer process started.')
logger.info('\tServer process id: '+str(cls.server_process.pid))
@ -1701,8 +1701,8 @@ def setUp(self):
self.SERVER_PORT = 30001
self.SERVER_PORT2 = 30002
command = ['python', 'simple_server.py', str(self.SERVER_PORT)]
command2 = ['python', 'simple_server.py', str(self.SERVER_PORT2)]
command = ['python', '-m', 'tuf.scripts.simple_server', str(self.SERVER_PORT)]
command2 = ['python', '-m', 'tuf.scripts.simple_server', str(self.SERVER_PORT2)]
self.server_process = subprocess.Popen(command, stderr=subprocess.PIPE,
cwd=self.repository_directory)