Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
maska989 committed Sep 27, 2023
1 parent 7b0c299 commit 20ff96e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ on:

jobs:
call-ci:
uses: phoenix-rtos/phoenix-rtos-project/.github/workflows/ci-submodule.yml@master
uses: phoenix-rtos/phoenix-rtos-project/.github/workflows/ci-submodule.yml@maska989/ping_test_ci_test
secrets: inherit
2 changes: 1 addition & 1 deletion micropython/test_repl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ test:
harness: micropython_repl.py
nightly: true
targets:
exclude: [armv7m7-imxrt106x-evk, armv7m7-imxrt117x-evk]
exclude: [armv7m7-imxrt106x-evk, armv7m7-imxrt117x-evk,ia32-generic-qemu]
# TODO fix test harness
ignore: true

Expand Down
2 changes: 1 addition & 1 deletion micropython/test_standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ test:
harness: micropython.py
nightly: true
targets:
value: [ia32-generic-qemu]
value: [ia32-generic-pc]

tests:
- name: basics.builtin_ellipsis
Expand Down
22 changes: 18 additions & 4 deletions psh/test-ping.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ def network_startup(p):
p.sendline("./etc/rc.d/network.sh")
psh_cmd = p.expect_exact(["(psh)% ", pexpect.TIMEOUT], timeout=10)

p.sendline("./etc/rc.d/network.sh")
psh_cmd = p.expect_exact(["(psh)% ", pexpect.TIMEOUT], timeout=10)

if psh_cmd == 1:
raise AssertionError("network.sh Timeout!")
# wait for full load of network.sh
time.sleep(5)
time.sleep(15)


def psh_ping_network_off(p):
Expand Down Expand Up @@ -71,8 +74,19 @@ def psh_ping_help(p):
def psh_ping(p):
counter = 0

# self ping
psh.assert_cmd(
p, f"ping {IP_LOOPBACK}", expected=ping_output_regex(IP_LOOPBACK, 5), result="success", is_regex=True
)

# google dns ping after linuxrc run (success)
psh.assert_cmd(p, f"ping {GOOGLE_DNS}", expected=ping_output_regex(GOOGLE_DNS, 5), result="success", is_regex=True)
psh.assert_cmd(
p,
f"ping {GOOGLE_DNS}",
expected=rf"{ping_output_regex(GOOGLE_DNS, 5)}|Host timeout",
result="dont-check",
is_regex=True,
)

# find TTL route
for i in range(1, 10):
Expand All @@ -89,14 +103,14 @@ def psh_ping(p):

assert counter > 0

# long ping (ping tics are every second that's why timeout 50)
# long ping (ping tics are every second that's why timeout 50 + 5 secs for hiccups)
psh.assert_cmd(
p,
f"ping -c 50 {GOOGLE_DNS}",
expected=ping_output_regex(GOOGLE_DNS, 50),
result="success",
is_regex=True,
timeout=50,
timeout=55,
)

# ping with long time to respond (IBM cloud name server).
Expand Down
3 changes: 1 addition & 2 deletions psh/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ test:
- name: ping
harness: test-ping.py
reboot: True
nightly: True
targets:
exclude: [armv7m7-imxrt106x-evk, armv7m7-imxrt117x-evk, armv7m4-stm32l4x6-nucleo, armv7a9-zynq7000-zedboard, armv7a9-zynq7000-qemu, ia32-generic-qemu]
exclude: [armv7m7-imxrt106x-evk, armv7m7-imxrt117x-evk, armv7m4-stm32l4x6-nucleo, armv7a9-zynq7000-zedboard, armv7a9-zynq7000-qemu]

0 comments on commit 20ff96e

Please sign in to comment.