Commit 05869a29 authored by Jan Kiene's avatar Jan Kiene
Browse files

use network simulator with wine on Linux

parent 1e5b5261
Loading
Loading
Loading
Loading
Loading
+18 −6
Original line number Diff line number Diff line
@@ -75,15 +75,17 @@ MODES = {
    "-MASA": {"1": "MASA1TC", "2": "MASA2TC"},
}
SNR_ID_SET = {"SNR", "SegSNR", "WSegSNR"}

if platform.system() == "Windows":
    TOOLS_DIR = os.path.realpath(
TOOLS_DIR_WIN = os.path.realpath(
    os.path.join(constants.SCRIPTS_BASE_DIR, "tools", "Win32")
)
elif platform.system() == "Linux":
    TOOLS_DIR = os.path.realpath(
TOOLS_DIR_LINUX = os.path.realpath(
    os.path.join(constants.SCRIPTS_BASE_DIR, "tools", "Linux")
)

if platform.system() == "Windows":
    TOOLS_DIR = TOOLS_DIR_WIN
elif platform.system() == "Linux":
    TOOLS_DIR = TOOLS_DIR_LINUX
elif platform.system() == "Darwin":
    if platform.uname().machine.endswith("64"):
        TOOLS_DIR = os.path.realpath(
@@ -988,7 +990,17 @@ class SelfTest(IvasScriptsCommon.IvasScript):
            proc_cmd = mode[1].pop(0).split()
            if proc_cmd[0] == "networkSimulator_g192":
                suffix = "nws"

            proc_cmd[0] = os.path.join(TOOLS_DIR, proc_cmd[0])
            print("before: ", proc_cmd)
            if suffix == "nws" and TOOLS_DIR == TOOLS_DIR_LINUX:
                # use wine
                proc_cmd[0] = os.path.join(TOOLS_DIR_WIN, "networkSimulator_g192.exe")
                print("during: ", proc_cmd)
                proc_cmd = ["wine"] + proc_cmd

            print("after: ", proc_cmd)

            proc_cmd = [
                "{in_file}" if x == in_file else self.test_for_file(x) for x in proc_cmd
            ]
−75.4 KiB

File deleted.