Skip to content

Crash in self_test.py related to suffix variable

When running self_test.py we encoutered the following crash:

Traceback (most recent call last):
  File "./self_test.py", line 1988, in <module>
    script.run()
  File "./self_test.py", line 1315, in run
    run_dict = self.parse_self_test_prm(self.args["test_prm"])
  File "./self_test.py", line 1147, in parse_self_test_prm
    self.create_mode_dict_entry(mode_dict, mode)
  File "./self_test.py", line 1021, in create_mode_dict_entry
    proc_cmd.append(suffix)
UnboundLocalError: local variable 'suffix' referenced before assignment

This is related to a missing value for the variable suffix in the "intermediate processing steps" section.

A quick fix is to add an else condition to always set the variable:

             if proc_cmd[0] == "networkSimulator_g192":
                 suffix = "nws"
             elif proc_cmd[0] == "eid-xor":
                 suffix = "fer"
+            else:
+                suffix = ""

Review from CI experts is requested, @kiene, @pihlajakuja (please tag others as relevant).