Skip to content

Commit 701fff3

Browse files
Added minor enhancements in keytest.py and qtest.py
Signed-off-by: Bhishma Acharya <bhishma@rtbrick.com>
1 parent 256731e commit 701fff3

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

test/keytest.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,15 @@
1313

1414
from oom import * # the published OOM Northbound API
1515
from oom.decode import get_hexstr # helper function from the decode pack
16+
import sys
1617

17-
# open port 0
18-
port = oom_get_port(0)
18+
# open port
19+
try:
20+
port = oom_get_port(int(sys.argv[1]))
21+
except Exception:
22+
print("Usage: python3 keytest.py <port-index>")
23+
print(" <port-index> starts from 0")
24+
sys.exit(0)
1925

2026
# get the internal list of keys and decoders for this type of module
2127
# report their values for this port

test/qtest.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,16 @@
1414
from oom import * # the published OOM Northbound API
1515
from oom.decode import get_hexstr # helper function from the decode pack
1616
from oom.oomlib import print_block_hex
17+
import sys
1718

19+
# open port
20+
try:
21+
port = oom_get_port(int(sys.argv[1]))
22+
except Exception:
23+
print("Usage: python3 keytest.py <port-index>")
24+
print(" <port-index> starts from 0")
25+
sys.exit(0)
1826

19-
# open port 5
20-
port = oom_get_port(5)
2127
print('0xA0, page 0, offset 0, 128 bytes')
2228
print_block_hex(oom_get_memory_sff(port, 0xA0, 0, 0, 128), 0)
2329
print("")

0 commit comments

Comments
 (0)