def test_http_client(qemu_mon_conn, liumos_serial_conn, liumos_builder_conn): test_util.expect_liumos_command_result( liumos_builder_conn, "app/httpserver/httpserver.bin --port 8888", "Listening port: 8888", 5) test_util.expect_liumos_command_result( liumos_serial_conn, "httpclient.bin --ip 10.0.2.2 --port 8888 --path /index.html", "HTTP/1.1 200 OK", 5) test_util.expect_liumos_command_result(liumos_serial_conn, "", "This is a sample paragraph.", 5)
def udp_client(qemu_mon_conn, liumos_serial_conn, liumos_builder_conn): test_util.expect_liumos_command_result( liumos_builder_conn, "app/udpserver/udpserver.bin 8888", "Listening port: 8888", 5); test_util.expect_liumos_command_result( liumos_serial_conn, "udpclient.bin 10.0.2.2 8888 LIUMOS_E2E_TEST_MESSAGE", "Sent size: 24", 5); test_util.expect_liumos_command_result( liumos_builder_conn, "", "LIUMOS_E2E_TEST_MESSAGE", 5);
#!/usr/bin/env python3 import time import sys import test_util if __name__ == "__main__": qemu_mon_conn = test_util.launch_qemu() time.sleep(1) liumos_serial_conn = test_util.connect_to_liumos_serial() time.sleep(1) test_util.expect_liumos_command_result( liumos_serial_conn, "ping.bin 10.0.2.2", "ICMP packet recieved from 10.0.2.2 ICMP Type = 0", 5) sys.exit(0)
#!/usr/bin/env python3 import time import sys import test_util if __name__ == "__main__": qemu_mon_conn = test_util.launch_liumos_on_docker() time.sleep(2) liumos_serial_conn = test_util.connect_to_liumos_serial() liumos_builder_conn = test_util.connect_to_liumos_builder() test_util.expect_liumos_command_result( liumos_serial_conn, "udpserver.bin 8889", "Listening port: 8889", 5); test_util.expect_liumos_command_result( liumos_builder_conn, "/liumos/app/udpclient/udpclient.bin 127.0.0.1 8889 LIUMOS_E2E_TEST_MESSAGE", "Sent size: 23", 5); test_util.expect_liumos_command_result( liumos_serial_conn, "", "LIUMOS_E2E_TEST_MESSAGE", 5); sys.exit(0)
def test_ping_to_router_on_qemu(qemu_mon_conn, liumos_serial_conn, liumos_builder_conn): test_util.expect_liumos_command_result( liumos_serial_conn, "ping.bin 10.0.2.2", "ICMP packet received from 10.0.2.2 ICMP Type = 0", 5)
#!/usr/bin/env python3 import time import sys import test_util if __name__ == "__main__": qemu_mon_conn = test_util.launch_qemu() time.sleep(1) liumos_serial_conn = test_util.connect_to_liumos_serial() time.sleep(1) test_util.expect_liumos_command_result( liumos_serial_conn, "ip", "10.0.2.15 eth 52:54:00:12:34:56 mask 255.255.255.0 gateway 10.0.2.2", 5) sys.exit(0)
def ip_assignment_on_qemu(qemu_mon_conn, liumos_serial_conn, liumos_builder_conn): test_util.expect_liumos_command_result( liumos_serial_conn, "ip", "10.0.2.15 eth 52:54:00:12:34:56 mask 255.255.255.0 gateway 10.0.2.2", 5)