[Bug 931] Trex config file (yaml) will break dts with valid yaml
bugzilla at dpdk.org
bugzilla at dpdk.org
Mon Jan 31 22:33:46 CET 2022
https://bugs.dpdk.org/show_bug.cgi?id=931
Bug ID: 931
Summary: Trex config file (yaml) will break dts with valid yaml
Product: DTS
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: framework
Assignee: dts at dpdk.org
Reporter: ohilyard at iol.unh.edu
Target Milestone: ---
framework/crb.py:503 (check_trex_process_existed)
```
if 'config_file' in conf_info:
config_file = conf_info['config_file']
else:
config_file = '/etc/trex_cfg.yaml'
fd = open(config_file, 'r')
output = fd.read()
fd.close()
prefix = re.search("prefix\s*:\s*(\S*)", output)
if prefix is not None:
self.trex_prefix = prefix.group(1)
```
This will break if quotes are used even though 'prefix: "trex1"' and 'prefix:
trex1' are semantically equivalent. An actual yaml parser should be used to
extract this information to avoid this fragility.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the dts
mailing list