Skip to content

tests: add test to test RDNSS option handling#13734

Merged
miri64 merged 1 commit intoRIOT-OS:masterfrom
miri64:tests/enh/rdnss-option
Apr 4, 2020
Merged

tests: add test to test RDNSS option handling#13734
miri64 merged 1 commit intoRIOT-OS:masterfrom
miri64:tests/enh/rdnss-option

Conversation

@miri64
Copy link
Member

@miri64 miri64 commented Mar 27, 2020

Contribution description

This provides a test for the Router Advertisement's RDNSS option to configure an upstream recursive DNS server.

Testing procedure

Run

make flash
sudo make test

for a supported board of your liking.

Issues/PRs references

See #13732 (comment)

@miri64 miri64 requested a review from benpicco March 27, 2020 09:44
@miri64 miri64 added Area: network Area: Networking Area: tests Area: tests and testing framework Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation labels Mar 27, 2020
@miri64 miri64 added this to the Release 2020.04 milestone Mar 27, 2020
@miri64 miri64 force-pushed the tests/enh/rdnss-option branch from 9b3ef07 to 4985551 Compare March 27, 2020 09:52
@miri64 miri64 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 27, 2020
@benpicco
Copy link
Contributor

Can you also craft a test with RDNSS and 6ctx - I have a suspicion here… 🤔

@miri64
Copy link
Member Author

miri64 commented Mar 27, 2020

Can you also craft a test with RDNSS and 6ctx - I have a suspicion here… thinking

If you don't tell me your suspicion, I can't really test. Also: Would be tricky, as scapy's support for 6LoWPAN is pretty incomplete and we don't really have a way for host interaction for this (ZEP maybe, but that's only working for native). Maybe its best if you dabble in the craft for this yourself ;-).

@benpicco
Copy link
Contributor

benpicco commented Mar 27, 2020

I see that with sock_dns enabled the nodes don't get a global prefix anymore. (They still seem to get the DNS information though)
This used to work not too long ago, but I'm still debugging…

@miri64
Copy link
Member Author

miri64 commented Mar 27, 2020

Added a Makefile.ci to the test.

@benpicco
Copy link
Contributor

benpicco commented Apr 2, 2020

I tried it on same54-xpro, this gives

sudo /home/benpicco/dev/RIOT/dist/tools/ethos/ethos tap0 /dev/ttyACM0 115200
----> ethos: sending hello.
----> ethos: activating serial pass through.

Traceback (most recent call last):
  File "/home/benpicco/dev/RIOT/tests/gnrc_ipv6_nib_dns/tests/01-run.py", line 82, in <module>
    sys.exit(run(testfunc, timeout=1, echo=True))
  File "/home/benpicco/dev/RIOT/dist/pythonlibs/testrunner/__init__.py", line 30, in run
    testfunc(child)
  File "/home/benpicco/dev/RIOT/tests/gnrc_ipv6_nib_dns/tests/01-run.py", line 66, in testfunc
    lladdr_src = get_host_lladdr(tap)
  File "/home/benpicco/dev/RIOT/tests/gnrc_ipv6_nib_dns/tests/01-run.py", line 44, in get_host_lladdr
    "Can't find host link-local address on interface {}".format(tap)
AssertionError: Can't find host link-local address on interface tap0
make: *** [/home/benpicco/dev/RIOT/tests/gnrc_ipv6_nib_dns/../../Makefile.include:733: test] Error 1

I also tried with running sudo dist/tools/tapsetup/tapsetup before (If nececary this should be added to the Makefile or Readme), which gives

sudo /home/benpicco/dev/RIOT/dist/tools/ethos/ethos tap0 /dev/ttyACM0 115200
----> ethos: sending hello.
----> ethos: activating serial pass through.
ifconfig
Timeout in expect script at "child.expect(r"HWaddr: (?P<hwaddr>[A-Fa-f:0-9]+)\s")" (tests/gnrc_ipv6_nib_dns/tests/01-run.py:68)

@miri64
Copy link
Member Author

miri64 commented Apr 3, 2020

I also tried with running sudo dist/tools/tapsetup/tapsetup before (If nececary this should be added to the Makefile or Readme), which gives

that script at the moment is for native only. So no surprise there. I will investigate what's wrong with non-native targets.

@miri64
Copy link
Member Author

miri64 commented Apr 3, 2020

Can reproduce. The other tests using ethos don't seem to work either anymore :-/. Will investigate.

@miri64
Copy link
Member Author

miri64 commented Apr 3, 2020

@benpicco what OS are you using? It seems on Arch Linux, the TAP interface created by ethos does not come up on its own.

@benpicco
Copy link
Contributor

benpicco commented Apr 3, 2020

I'm on Ubuntu 19.10

@miri64
Copy link
Member Author

miri64 commented Apr 3, 2020

Good thing, that we now can use start_network.sh without uhcpd ;-).

@benpicco
Copy link
Contributor

benpicco commented Apr 3, 2020

Now I get

/home/benpicco/dev/RIOT/dist/tools/ethos/start_network.sh: 68: [: -eq: unexpected operator

@miri64
Copy link
Member Author

miri64 commented Apr 3, 2020

Now I get

/home/benpicco/dev/RIOT/dist/tools/ethos/start_network.sh: 68: [: -eq: unexpected operator

Did create_tap fail for you for some reason (this should be better handled, but maybe in a different PR) ;-).

@benpicco
Copy link
Contributor

benpicco commented Apr 3, 2020

ioctl(TUNSETIFF): Device or resource busy

Oh I already had a tap device set up for a different test - with those deleted I get

sudo /home/benpicco/dev/RIOT/dist/tools/ethos/start_network.sh -e /dev/ttyACM1 tap0 "2001:db8::/32" 115200
net.ipv6.conf.tap0.forwarding = 1
net.ipv6.conf.tap0.accept_ra = 0
----> ethos: sending hello.
----> ethos: activating serial pass through.

s
s

no response

@miri64
Copy link
Member Author

miri64 commented Apr 3, 2020

Can you please check if

a) you flashed the right application before hand ;-)
b) you have the same problem on master?

With samr21-xpro (so UART0_DEV over USB) this works. Maybe your board does not provide UART over USB or something like that.

@benpicco
Copy link
Contributor

benpicco commented Apr 3, 2020

Yes it's working on samr21-xpro and saml10-xpro - I must have messed something up there on same54-xpro 😳

On those other boards I get

net.ipv6.conf.tap0.forwarding = 1
net.ipv6.conf.tap0.accept_ra = 0
----> ethos: sending hello.
----> ethos: activating serial pass through.
----> ethos: hello reply received
ifconfig

> 
> ifconfig
Iface  5  HWaddr: 00:C5:E5:2B:18:4E 
          L2-PDU:1500 MTU:1500  HL:64  Source address length: 6
          Link type: wired
          inet6 addr: fe80::2c5:e5ff:fe2b:184e dns server
 scope: link  VAL
          inet6 group: ff02::1
          inet6 group: ff02::1:ff2b:184e
          
> dns server
DNS server: -.
Sent 1 packets.
dns server

> dns server
DNS server: [2001:db8:affe::dead:beef]:5
Traceback (most recent call last):
  File "/home/benpicco/dev/RIOT/tests/gnrc_ipv6_nib_dns/tests/01-run.py", line 82, in <module>
    sys.exit(run(testfunc, timeout=1, echo=True))
  File "/home/benpicco/dev/RIOT/dist/pythonlibs/testrunner/__init__.py", line 30, in run
    testfunc(child)
  File "/home/benpicco/dev/RIOT/tests/gnrc_ipv6_nib_dns/tests/01-run.py", line 77, in testfunc
    assert dns_server(child) == (DNS_ADDR, DNS_PORT)
AssertionError

Maybe that's because I ran make test with sudo?

Without sudo I get

sudo /home/benpicco/dev/RIOT/dist/tools/ethos/start_network.sh -e /dev/ttyACM1 tap0 "2001:db8::/32" 115200
[sudo] password for benpicco: 




Sorry, try again.
[sudo] password for benpicco: 


Sorry, try again.
[sudo] password for benpicco: 


Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 111, in expect_loop
    incoming = spawn.read_nonblocking(spawn.maxread, timeout)
  File "/usr/lib/python3/dist-packages/pexpect/pty_spawn.py", line 482, in read_nonblocking
    raise TIMEOUT('Timeout exceeded.')
pexpect.exceptions.TIMEOUT: Timeout exceeded.

(I didn't get to enter my password there)

@benpicco
Copy link
Contributor

benpicco commented Apr 3, 2020

With only one board connected, the test is working (sometimes).
There seems to be a race condition where the test starts before tap0 is ready.

tap0 stays configured after the test, so the second run of the test is usually successful.

@miri64
Copy link
Member Author

miri64 commented Apr 3, 2020

tap0 stays configured after the test, so the second run of the test is usually successful.

Mhhhh it should be removed on cleanup in start_network.sh...

@miri64
Copy link
Member Author

miri64 commented Apr 3, 2020

Reverted my last commit as this does not seem to be an ethos issue after all. See #13802

@miri64
Copy link
Member Author

miri64 commented Apr 3, 2020

(confirmed to be working on iotlab-m3)

@benpicco
Copy link
Contributor

benpicco commented Apr 4, 2020

I can confirm the test is working now on same54-xpro

output
----> ethos: sending hello.
----> ethos: activating serial pass through.
write to fd 3 failed: Invalid argument
----> ethos: hello reply received
ifconfig

> 
> ifconfig
Iface  5  HWaddr: 02:EB:39:55:B4:C3 
          L2-PDU:1500 MTU:1500  HL:64  Source address length: 6
          Link type: wired
          inet6 addr: fe80::eb:39ff:fe55:b4c3  scope: link  VAL
dns server
          inet6 group: ff02::1
          inet6 group: ff02::1:ff55:b4c3
          
> dns server
DNS server: -
.
Sent 1 packets.
dns server
> dns server
DNS server: [2001:db8:affe::dead:beef%5]:53

Please squash!

Copy link
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test works as expected.

@miri64
Copy link
Member Author

miri64 commented Apr 4, 2020

Squashed

@miri64 miri64 force-pushed the tests/enh/rdnss-option branch from 90c81b5 to b87ba69 Compare April 4, 2020 22:55
Comment on lines +78 to +80



Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many empty lines for flake8s liking (just squash directly)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grmlbrml... vim + middle click + thinkpad scrolling... very bad combination ;-P

@miri64 miri64 force-pushed the tests/enh/rdnss-option branch from b87ba69 to 94edc5a Compare April 4, 2020 23:16
@miri64 miri64 merged commit 6e27a8e into RIOT-OS:master Apr 4, 2020
@miri64 miri64 deleted the tests/enh/rdnss-option branch July 17, 2020 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: network Area: Networking Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants