Cert_5_1_01_RouterAttach.py Script Execution

64 views
Skip to first unread message

ias my dream

unread,
Oct 24, 2018, 3:16:28 AM10/24/18
to openthread-users
Hi

I just tried to run the router attach script in python (codelab).

See the execution:

Failure: EXCEPTION: 'module' object has no attribute 'MODE_CCM'

This seems to be because of Makefile-posix build. Let me know if there is any workaround.
Is it possible to configure the MODE_CCM. mode is "rsdn" here.

Script output:
 
root@chn-aero-vm014:/home/ubuntu/karthik/openthread/tests/scripts/thread-cert#  top_builddir=../../../build/x86_64-unknown-linux-gnu python Cert_5_1_01_RouterAttach.py ../../../build/x86_64-unknown-linux-gnu/examples/apps/cli/ot-cli-ftd 1
1: macfilter addr clear
1: macfilter addr disable
1: childtimeout 100
../../../build/x86_64-unknown-linux-gnu/examples/apps/cli/ot-cli-ftd 2
2: macfilter addr clear
2: macfilter addr disable
2: childtimeout 100
1: panid 64206
1: mode rsdn
2: extaddr
1: macfilter addr add dabb4895ae5d3bed
1: macfilter addr whitelist
2: panid 64206
2: mode rsdn
1: extaddr
2: macfilter addr add ce28dc685453e154
2: macfilter addr whitelist
2: routerselectionjitter 1
1: ifconfig up
1: thread start
EXCEPTION: 'module' object has no attribute 'MODE_CCM'
EXCEPTION: 'module' object has no attribute 'MODE_CCM'
EXCEPTION: 'module' object has no attribute 'MODE_CCM'
EXCEPTION: 'module' object has no attribute 'MODE_CCM'
EXCEPTION: 'module' object has no attribute 'MODE_CCM'
1: state
F1: thread stop
1: ifconfig down
1: exit
2: thread stop
2: ifconfig down
2: exit
======================================================================
FAIL: test (__main__.Cert_5_1_01_RouterAttach)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Cert_5_1_01_RouterAttach.py", line 71, in test
    self.assertEqual(self.nodes[LEADER].get_state(), 'leader')
AssertionError: 'router' != 'leader'
----------------------------------------------------------------------
Ran 1 test in 6.660s
FAILED (failures=1)

Thanks
Karthik

Yakun Xu

unread,
Oct 24, 2018, 3:34:04 AM10/24/18
to openthread-users
Have you installed the requirements.txt?

pip install -r tests/scripts/thread-cert/requirements.txt

ias my dream

unread,
Oct 24, 2018, 5:27:30 AM10/24/18
to openthread-users
May I know the relevance of these variables?

enum34
ipaddress
pexpect
pycryptodome

Thanks
Karthik

Yakun Xu

unread,
Oct 24, 2018, 5:31:23 AM10/24/18
to openthread-users
I'm not sure what you means. These are python dependencies for running OpenThread tests. You can install them by:

pip install -r requirements.txt

ias my dream

unread,
Oct 24, 2018, 7:03:11 AM10/24/18
to openthread-users
Thanks Yakun Xu.

Bellampalli Srikanth

unread,
Oct 24, 2018, 8:16:44 AM10/24/18
to openthread-users
Hi Yakun Xu,


thank you for the assistance, I have installed the requirements.txt as you suggested and tried to execute the test script again but gave me the below error. 
could you please have a look and let me know any further procedure.

thread-cert$ pip install -r requirements.txt
Collecting enum34==1.1.2 (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/6f/e9/08fd439384b7e3d613e75a6c8236b8e64d90c47d23413493b38d4229a9a5/enum34-1.1.2.tar.gz (46kB)
    100% |████████████████████████████████| 51kB 683kB/s
Collecting ipaddress==1.0.16 (from -r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/23/6a/813ac29a01e4c33c19c2bded98ac3d4266ebbf0bd2c0eb0020e1c969958d/ipaddress-1.0.16-py27-none-any.whl
Collecting pexpect==4.0.1 (from -r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/88/50/3aa199018e996bcf963a81160083fd30557c3d4dab72eb1e9cce3afb69e7/pexpect-4.0.1.tar.gz (143kB)
    100% |████████████████████████████████| 153kB 603kB/s
Collecting pycryptodome==3.4.3 (from -r requirements.txt (line 4))
  Downloading https://files.pythonhosted.org/packages/45/ef/4514a01be3d8f5383cd12fc5612ffd8a2508ac7e7ff6bde2da708e71c9a3/pycryptodome-3.4.3.tar.gz (6.5MB)
    100% |████████████████████████████████| 6.5MB 81kB/s
Collecting ptyprocess>=0.5 (from pexpect==4.0.1->-r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/d1/29/605c2cc68a9992d18dada28206eeada56ea4bd07a239669da41674648b6f/ptyprocess-0.6.0-py2.py3-none-any.whl
Building wheels for collected packages: enum34, pexpect, pycryptodome
  Running setup.py bdist_wheel for enum34 ... done
  Stored in directory: /home/ubuntu/.cache/pip/wheels/d9/ad/b8/0baf62318ab81499a7209d6b883dff8744f2116778e13a2092
  Running setup.py bdist_wheel for pexpect ... done
  Stored in directory: /home/ubuntu/.cache/pip/wheels/a7/8b/61/1c5ec2a1ac08abd0b837d81e0ccbb48cee3e25cca8d9029b5b
  Running setup.py bdist_wheel for pycryptodome ... done
  Stored in directory: /home/ubuntu/.cache/pip/wheels/8f/9d/63/f6aea5612d1682a50b25857b0358e2ecec878a0bc42ba3af4c
Successfully built enum34 pexpect pycryptodome
Installing collected packages: enum34, ipaddress, ptyprocess, pexpect, pycryptodome
Successfully installed enum34-1.1.2 ipaddress-1.0.16 pexpect-4.0.1 ptyprocess-0.6.0 pycryptodome-3.4.3
ubuntu@chn-aero-vm014:~/srikanth/openthread/tests/scripts/thread-cert$ top_builddir=../../../build/x86_64-unknown-linux-gnu python Cert_5_1_01_RouterAttach.py

../../../build/x86_64-unknown-linux-gnu/examples/apps/cli/ot-cli-ftd 1
1: macfilter addr clear
E
======================================================================
ERROR: test (__main__.Cert_5_1_01_RouterAttach)

----------------------------------------------------------------------
Traceback (most recent call last):
  File "Cert_5_1_01_RouterAttach.py", line 49, in setUp
    self.nodes[i] = node.Node(i, simulator=self.simulator)
  File "/home/ubuntu/srikanth/openthread/tests/scripts/thread-cert/node.py", line 49, in __init__
    self.interface.clear_whitelist()
  File "/home/ubuntu/srikanth/openthread/tests/scripts/thread-cert/node_cli.py", line 179, in clear_whitelist
    self.pexpect.expect('Done')
  File "/home/ubuntu/.local/lib/python2.7/site-packages/pexpect/spawnbase.py", line 315, in expect
    timeout, searchwindowsize, async)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/pexpect/spawnbase.py", line 339, in expect_list
    return exp.expect_loop(timeout)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/pexpect/expect.py", line 102, in expect_loop
    return self.eof(e)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/pexpect/expect.py", line 49, in eof
    raise EOF(msg)
EOF: End Of File (EOF). Exception style platform.
<pexpect.pty_spawn.spawn object at 0x7fa28032db10>
command: ../../../build/x86_64-unknown-linux-gnu/examples/apps/cli/ot-cli-ftd
args: ['../../../build/x86_64-unknown-linux-gnu/examples/apps/cli/ot-cli-ftd', '1']
searcher: None
buffer (last 100 chars): ''
before (last 100 chars): 'bind: Address already in use\r\nmacfilter addr clear\r\n'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: 1
flag_eof: True
pid: 53503
child_fd: 6
closed: False
timeout: 4
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
----------------------------------------------------------------------
Ran 1 test in 0.358s
FAILED (errors=1)

Jonathan Hui

unread,
Oct 24, 2018, 2:16:10 PM10/24/18
to sri8ind...@gmail.com, openthre...@googlegroups.com
The posix simulator emulates IEEE 802.15.4 radio communication using UDP sockets over loopback. The bind failure indicates that the UDP ports are already opened, probably by other OpenThread processes.

Can you see if there are other `ot-cli-ftd` processes running and, if so, kill all such processes before running the python test scripts again?

--
Jonathan Hui

--
You received this message because you are subscribed to the Google Groups "openthread-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openthread-use...@googlegroups.com.
To post to this group, send email to openthre...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openthread-users/39c6cb7a-bd37-4ba2-8073-a185935f1f70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

srikanth reddy

unread,
Oct 25, 2018, 2:20:03 AM10/25/18
to Jonathan Hui, openthre...@googlegroups.com
Hi Jonathan Hui,

Thank you very much for your help, I have followed the instructions and test scripts are getting executed.

Thank you

Bellampalli Srikanth

unread,
Oct 30, 2018, 7:02:33 AM10/30/18
to openthread-users
Hi,

while executing the scripts few test scripts are failure, I tried to analyze and understand that cause of failure and came to know that every test script that has to execute this line of instruction :
In test
    msg = leader_messages.next_mle_message(mle.CommandType.ADVERTISEMENT)

is causing the whole script failure.

Please could you check the below output and share your comments. thank you.

PFB is my observation for test scripts Router Attach and Leader Reboot.
tests/scripts/thread-cert# sudo top_builddir=../../../build/x86_64-unknown-linux-gnu python Cert_5_1_01_RouterAttach.py

../../../build/x86_64-unknown-linux-gnu/examples/apps/cli/ot-cli-ftd 1
1: macfilter addr clear
1: macfilter addr disable
1: childtimeout 100
../../../build/x86_64-unknown-linux-gnu/examples/apps/cli/ot-cli-ftd 2
2: macfilter addr clear
2: macfilter addr disable
2: childtimeout 100
1: panid 64206
1: mode rsdn
2: extaddr
1: macfilter addr add 02add07c0ab8eb5f

1: macfilter addr whitelist
2: panid 64206
2: mode rsdn
1: extaddr
2: macfilter addr add 7e0b52fef87dc8fb

2: macfilter addr whitelist
2: routerselectionjitter 1
1: ifconfig up
1: thread start
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
1: state
2: ifconfig up
2: thread start
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: 26625
EXCEPTION: 26624
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
2: state

F1: thread stop
1: ifconfig down
1: exit
2: thread stop
EXCEPTION: MAC check failed

2: ifconfig down
2: exit
======================================================================
FAIL: test (__main__.Cert_5_1_01_RouterAttach)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Cert_5_1_01_RouterAttach.py", line 81, in test
    msg = leader_messages.next_mle_message(mle.CommandType.ADVERTISEMENT)
  File "/home/ubuntu/srikanth/openthread/tests/scripts/thread-cert/message.py", line 376, in next_mle_message
    assert message is not None, "Could not find MleMessage of the type: {}".format(command_type)
AssertionError: Could not find MleMessage of the type: 4
----------------------------------------------------------------------
Ran 1 test in 13.830s
FAILED (failures=1)
===================================================================================================================================
tests/scripts/thread-cert# sudo top_builddir=../../../build/x86_64-unknown-linux-gnu python Cert_5_5_01_LeaderReboot.py

../../../build/x86_64-unknown-linux-gnu/examples/apps/cli/ot-cli-ftd 1
1: macfilter addr clear
1: macfilter addr disable
1: childtimeout 100
../../../build/x86_64-unknown-linux-gnu/examples/apps/cli/ot-cli-ftd 2
2: macfilter addr clear
2: macfilter addr disable
2: childtimeout 100
1: panid 64206
1: mode rsdn
2: extaddr
1: macfilter addr add 02add07c0ab8eb5f

1: macfilter addr whitelist
2: panid 64206
2: mode rsdn
1: extaddr
2: macfilter addr add 7e0b52fef87dc8fb

2: macfilter addr whitelist
2: routerselectionjitter 1
1: ifconfig up
1: thread start
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
1: state
2: ifconfig up
2: thread start
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: 26625
EXCEPTION: 26624
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
EXCEPTION: MAC check failed
2: state
F1: thread stop
EXCEPTION: MAC check failed

1: ifconfig down
1: exit
2: thread stop
2: ifconfig down
2: exit
======================================================================
FAIL: test (__main__.Cert_5_5_1_LeaderReboot)

----------------------------------------------------------------------
Traceback (most recent call last):
  File "Cert_5_5_01_LeaderReboot.py", line 82, in test
    msg = leader_messages.next_mle_message(mle.CommandType.ADVERTISEMENT)
  File "/home/ubuntu/srikanth/openthread/tests/scripts/thread-cert/message.py", line 376, in next_mle_message
    assert message is not None, "Could not find MleMessage of the type: {}".format(command_type)
AssertionError: Could not find MleMessage of the type: 4
----------------------------------------------------------------------
Ran 1 test in 11.823s
FAILED (failures=1)

Jonathan Hui

unread,
Oct 30, 2018, 11:49:11 PM10/30/18
to Bellampalli Srikanth, openthre...@googlegroups.com
Do you see a `tmp` directory that contains `*.flash` files where you executed the command from? If so, try removing the directory before running each test.

The `*.flash` files is the settings storage for each simulated node. The tests assume that each simulated device is starting from a factory-reset state.

Hope that helps.

--
Jonathan Hui

Bellampalli Srikanth

unread,
Oct 31, 2018, 5:03:34 AM10/31/18
to openthread-users
Thank you Jonathan Hui.

As you suggested, I have removed the tmp dir which has *.files and executed the scripts successfully.

scripts are executable. thanks.
Reply all
Reply to author
Forward
0 new messages