MCPcopy Create free account
hub / github.com/F-Stack/f-stack / runHistoryTest

Function runHistoryTest

dpdk/app/test-cmdline/cmdline_test.py:33–49  ·  view source on GitHub ↗
(child)

Source from the content-addressed store, hash-verified

31# This is a self-contained test, it needs only a pexpect child
32#
33def runHistoryTest(child):
34 # find out history size
35 child.sendline(cmdline_test_data.CMD_GET_BUFSIZE)
36 child.expect("History buffer size: \\d+", timeout=1)
37 history_size = int(child.after[len(cmdline_test_data.BUFSIZE_TEMPLATE):])
38 i = 0
39
40 # fill the history with numbers
41 while i < history_size // 10:
42 # add 1 to prevent from parsing as octals
43 child.send("1" + str(i).zfill(8) + cmdline_test_data.ENTER)
44 # the app will simply print out the number
45 child.expect(str(i + 100000000), timeout=1)
46 i += 1
47 # scroll back history
48 child.send(cmdline_test_data.UP * (i + 2) + cmdline_test_data.ENTER)
49 child.expect("100000000", timeout=1)
50
51# the path to cmdline_test executable is supplied via command-line.
52if len(sys.argv) < 2:

Callers 1

cmdline_test.pyFile · 0.85

Calls 1

sendMethod · 0.80

Tested by

no test coverage detected