summaryrefslogtreecommitdiffstats
path: root/unitest-xmlrpc.py
diff options
context:
space:
mode:
authornicolargo <nicolas@nicolargo.com>2022-10-31 08:40:46 +0100
committernicolargo <nicolas@nicolargo.com>2022-10-31 08:40:46 +0100
commit2b8ae361d1d3b4239e29ac46bee727d013df5797 (patch)
treee3aeefbf73b1d5f3e20bdf2da5d3431df6a330eb /unitest-xmlrpc.py
parent9758d18db17ff32ebb5f44b37d63783fa04845d6 (diff)
Improve unitary test for client/server by using venv if possible
Diffstat (limited to 'unitest-xmlrpc.py')
-rwxr-xr-xunitest-xmlrpc.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/unitest-xmlrpc.py b/unitest-xmlrpc.py
index c639f994..8b836f3a 100755
--- a/unitest-xmlrpc.py
+++ b/unitest-xmlrpc.py
@@ -15,6 +15,7 @@ import shlex
import subprocess
import time
import unittest
+import os
from glances import __version__
from glances.compat import ServerProxy
@@ -43,7 +44,11 @@ class TestGlances(unittest.TestCase):
global pid
print('INFO: [TEST_000] Start the Glances Web Server')
- cmdline = "python -m glances -B localhost -s -p %s" % SERVER_PORT
+ if os.path.isfile("./venv/bin/python"):
+ cmdline = "./venv/bin/python"
+ else:
+ cmdline = "python"
+ cmdline += " -m glances -B localhost -s --disable-autodiscover -p %s" % SERVER_PORT
print("Run the Glances Server on port %s" % SERVER_PORT)
args = shlex.split(cmdline)
pid = subprocess.Popen(args)