Closed yi-liang closed 7 years ago
Can you share a log?
Is it possible the output is slightly different depending on if a user connects via serial console port vs ethernet port? Or maybe different versions of commands?
On my router:
$ ssh root@192.168.1.1 'lsmod | wc -l' > test.txt
$ cat -A test.txt
102$
That last $
I think means just the \n
character. If there was a \r
it would display as ^M
?
Sure, the log: ==================== Begin KernelModules ====================
root@OpenWrt:/# root@OpenWrt:/# | wcroot@OpenWrt:/# -lroot@OpenWrt:/# lsmod | wc -l 108 root@OpenWrt:/# root@OpenWrt:/#
TEST_CASE_RESULT = FAIL
=========== Test failed! Running recovery =========== File "/home/jenkins/boardfarm/boardfarm/tests/linux_boot.py", line 72, in testWrapper self.runTest() File "/home/jenkins/boardfarm/boardfarm/tests/lsmod.py", line 16, in runTest board.expect('(\d+)\r\n') File "/home/jenkins/boardfarm/boardfarm/devices/openwrt_router.py", line 436, in expect return super(OpenWrtRouter, self).expect(_args, *_kwargs)
| wc -l 108 root@OpenWrt:/# root@OpenWrt:/#
thanks, @mbanders , in my case it was connecting via serial port, not sure about the command version, seems there is also a "$" at the end
$ ssh root@192.168.0.2 'lsmod | wc -l' > test.txt
$ cat -A test.txt
108$
I made it safer and fewer lines of code, please review it: https://github.com/qca/boardfarm/pull/67
It seems the test "KernelModules" failed because in boardfarm/tests/lsmod.py, line 14-16 board.sendline('\nlsmod | wc -l') board.expect('lsmod ') board.expect('(\d+)\r\n') looks like it was verifying the response from "lsmod | wc -l" but the returned string would be a number without "/r/n"? If changed to board.expect('(\d+)') then the test can pass