KatharaFramework / kathara-lab-checker

Tool to automatically check Kathará network scenarios based on a configuration file.
https://www.kathara.org/
GNU General Public License v3.0
3 stars 1 forks source link

problem with relative path #10

Closed xReniar closed 2 weeks ago

xReniar commented 2 weeks ago

when creating tests, when passing only the .conf file to the structure field like this:

{
    "labs_path": "../mirada",
    "convergence_time": "30",
    "structure": "lab.conf", # not working
    "test": {

    }
}

I get this error:

Parsing test configuration...
Parsing network scenarios template in: lab.conf
Traceback (most recent call last):
  File "/home/rainer/anaconda3/envs/kathara/bin/kathara-lab-checker", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/rainer/anaconda3/envs/kathara/lib/python3.11/site-packages/main.py", line 341, in main
    template_lab = LabParser().parse(
                   ^^^^^^^^^^^^^^^^^^
  File "/home/rainer/anaconda3/envs/kathara/lib/python3.11/site-packages/Kathara/parser/netkit/LabParser.py", line 27, in parse
    raise IOError(f"No {conf_name} in given directory.")
OSError: No lab.conf in given directory.

the structure field does not use the relative path set by labs_path, it works only when modifying the structure like this:

{
    "labs_path": "../mirada",
    "convergence_time": "30",
    "structure": "../mirada/lab.conf", # working
    "test": {

    }
}
lorenzo93 commented 2 weeks ago

This is an expected behavior. You should use a "master version" of the lab.conf and not the one to be checked, otherwise the check is useless because those are the same files