I followed the instruction to setup basic harness based on below url.
https://pubhub.devnetcloud.com/media/pyats-packages/docs/genie/userguide/harness/user/gettingstarted.html?highlight=grun
The job file (harness1.py) is as below
import os
from genie.harness.main import gRun
def main():
test_path = os.path.dirname(os.path.abspath(__file__))
gRun(mapping_datafile=os.path.join(test_path, 'mapping.yaml'))
The mapping.yaml file is as below
devices:
uut:
context: cli
label: uut
mapping:
cli: vty
The testbed file(testbed_csrv.yaml) is as below
testbed:
name: GenieTest
tacacs:
username: cisco
passwords:
tacacs: cisco
enable: cisco
line: cisco
devices:
R1:
alias: 'uut'
os: 'iosxe'
type: 'CSR1000v'
connections:
defaults:
class: 'unicon.Unicon'
vty:
protocol: ssh
ip: 172.16.100.130
port: 22
When I run easypy harness1.py --testbed_file testbed_csrv.yaml, I got below error message
Caught error while executing the test script:
2019-08-19T20:58:32: %GENIE-ERROR: Traceback (most recent call last):
2019-08-19T20:58:32: %GENIE-ERROR: File "src/genie/harness/main.py", line 379, in genie.harness.main.Genie.run
2019-08-19T20:58:32: %GENIE-ERROR: File "src/genie/harness/script.py", line 163, in genie.harness.script.TestScript.organize_testbed
2019-08-19T20:58:32: %GENIE-ERROR: File "src/genie/conf/main.py", line 73, in genie.conf.main.Genie.init
2019-08-19T20:58:32: %GENIE-ERROR: TypeError: Argument should be a pyATS Testbed object but received object of type <class 'NoneType'>
I cannot figure out why the argument received as NoneType object.
Also when edit the harness1.py, pycharm displayed errors for the import.
Unresolved reference 'gRun' and Cannot find reference 'main' in '_init_.py'.
Are they potentially the cause for the testbed object issue?
Thank you in advance.