Skip to content

Update to Python tests #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a0a7c8f
Python 3 syntax changes
bobjacobsen May 28, 2023
d9262e8
p3; improve output
bobjacobsen May 28, 2023
fe2b765
python3
bobjacobsen May 28, 2023
6dc447e
for py3
bobjacobsen May 28, 2023
42d2f92
py3
bobjacobsen May 28, 2023
f7e24b7
drop unavailable option
bobjacobsen May 28, 2023
cc17d8b
add expect(..)
bobjacobsen May 28, 2023
dd3f152
py3, functional updatesaliasMapEnquiry.py
bobjacobsen May 29, 2023
c9daca1
py3, functional updatesaliasMapEnquiry.py
bobjacobsen May 29, 2023
8a26fcc
get -t to work
bobjacobsen May 29, 2023
943643e
improved expect
bobjacobsen May 29, 2023
1de45a5
py3
bobjacobsen May 29, 2023
c68d104
py3
bobjacobsen May 29, 2023
86d72bc
py3
bobjacobsen May 29, 2023
d261942
better debug, still py2
bobjacobsen May 29, 2023
da94dee
handle range replies
bobjacobsen May 29, 2023
0a02edb
2to3
bobjacobsen May 29, 2023
cad6475
2to3
bobjacobsen May 29, 2023
2a46120
buffer size, schema location
bobjacobsen May 29, 2023
ed3d823
pause to clear in case of error
bobjacobsen May 29, 2023
a143d65
2to3, comment, default
bobjacobsen May 29, 2023
cdd21b8
limit wait for response
bobjacobsen May 29, 2023
15de194
2to3
bobjacobsen May 29, 2023
4506092
debug info
bobjacobsen May 29, 2023
685393c
fix test decoding
bobjacobsen May 29, 2023
1bce68d
clean up
bobjacobsen May 29, 2023
f2f80a8
handle intermingled 2nd allocation
bobjacobsen May 30, 2023
3819368
better fail output
bobjacobsen May 30, 2023
7fc9617
clarification
bobjacobsen May 30, 2023
c707215
comments and clarification
bobjacobsen May 30, 2023
018b90d
add some clarifications
bobjacobsen May 30, 2023
bf34fa0
better default operation
bobjacobsen May 30, 2023
ec863b3
rm CR, LF; fix data check
bobjacobsen May 30, 2023
3b863b3
run all tests before return value
bobjacobsen May 30, 2023
3297cd0
to run with LRT Fast Clock implementation of protocol options
bobjacobsen May 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 18 additions & 23 deletions aliasMapEnquiry.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,45 +67,40 @@ def main():
if options.veryverbose :
connection.network.verbose = True

'''
@todo identifynode option not currently implemented
'''
#if options.identifynode :
# import getUnderTestAlias
# options.dest, otherNodeId = getUnderTestAlias.get(options.alias,
# None,
# options.verbose)
# if options.nodeid == None :
# options.nodeid = otherNodeId
if options.identifynode :
import getUnderTestAlias
options.dest, options.nodeid = getUnderTestAlias.get(options.alias, None, options.verbose or options.veryverbose)

retval = test(options.alias, options.dest, options.nodeid, connection,
options.verbose)
connection.network.close()
exit(retval)

def test(alias, dest, nodeID, connection, verbose) :
retval = 0

# check with node id in frame
connection.network.send(makeframe(alias, nodeID))
expect = canolcbutils.makeframestring(0x10701000 + dest, nodeID)
if (connection.network.expect(exact=expect) == None) :
print "Expected reply when node ID matches not received"
return 2
if (connection.network.expect(startswith=expect) == None) :
print ("Expected reply "+expect+" when node ID matches not received")
retval = retval | 1

# check without node id in frame
# check without node id in frame
connection.network.send(canolcbutils.makeframestring(0x10702000+alias,None))
expect = canolcbutils.makeframestring(0x10701000 + dest, nodeID)
if (connection.network.expect(exact=expect) == None) :
print "Expected reply when node ID matches not received"
return 2
if (connection.network.expect(startswith=expect) == None) :
print ("Expected reply when node ID matches not received")
retval = retval | 2

# test non-matching NodeID using a reserved one
connection.network.send(makeframe(alias, [0,0,0,0,0,1]))
reply = connection.network.receive()
if (connection.network.expect(exact=expect) != None) :
print "Unexpected reply received when node ID didnt match ", reply
return 2
return 0
if (connection.network.expect(startswith=expect) != None) :
print ("Unexpected reply received when node ID didnt match ", reply)
retval = retval | 4

return retval

if __name__ == '__main__':
main()
Loading