From 855bdd6d16f387540ec72d579c4c6348ab4a0658 Mon Sep 17 00:00:00 2001 From: Ivan Baravy Date: Mon, 6 Feb 2023 16:23:48 +0000 Subject: [PATCH] Enable static network tests --- shell.c | 3 - test/022_#net_#f74_all.ref.log | 96 +++++++++++++++ ...22_#net_#f74_all.d => 022_#net_#f74_all.t} | 1 + test/023_#net_#f75_all.d | 8 +- test/024_#net_#f76_all.ref.log | 41 +++++++ ...24_#net_#f76_all.d => 024_#net_#f76_all.t} | 1 + test/025_#net_#arp_#f76_all.ref.log | 111 ++++++++++++++++++ ...rp_#f76_all.d => 025_#net_#arp_#f76_all.t} | 1 + 8 files changed, 255 insertions(+), 7 deletions(-) create mode 100644 test/022_#net_#f74_all.ref.log rename test/{022_#net_#f74_all.d => 022_#net_#f74_all.t} (98%) create mode 100644 test/024_#net_#f76_all.ref.log rename test/{024_#net_#f76_all.d => 024_#net_#f76_all.t} (97%) create mode 100644 test/025_#net_#arp_#f76_all.ref.log rename test/{025_#net_#arp_#f76_all.d => 025_#net_#arp_#f76_all.t} (99%) diff --git a/shell.c b/shell.c index 7128441..d520f44 100644 --- a/shell.c +++ b/shell.c @@ -2876,8 +2876,6 @@ cmd_load_dll(struct shell_ctx *ctx, int argc, char **argv) { fprintf(ctx->fout, "### export: %p\n", export); } - - static void cmd_stack_init(struct shell_ctx *ctx, int argc, char **argv) { (void)ctx; @@ -3644,7 +3642,6 @@ cmd_net_arp_del_entry(struct shell_ctx *ctx, int argc, char **argv) { } } - static void cmd_osloop(struct shell_ctx *ctx, int argc, char **argv) { (void)ctx; diff --git a/test/022_#net_#f74_all.ref.log b/test/022_#net_#f74_all.ref.log new file mode 100644 index 0000000..1b444b7 --- /dev/null +++ b/test/022_#net_#f74_all.ref.log @@ -0,0 +1,96 @@ +/> umka_boot +/> net_get_dev_count +active network devices: 0 +/> stack_init +/> net_get_dev_count +active network devices: 1 +/> net_add_device +device number: 1 +/> net_get_dev_count +active network devices: 2 +/> net_add_device +device number: 2 +/> net_get_dev_count +active network devices: 3 +/> net_add_device +device number: 3 +/> net_get_dev_count +active network devices: 4 +/> net_get_dev_type 0 +status: ok +type of network device #0: 0 +/> net_get_dev_type 1 +status: ok +type of network device #1: 1 +/> net_get_dev_type 2 +status: ok +type of network device #2: 1 +/> net_get_dev_name 0 +status: ok +name of network device #0: loopback +/> net_get_dev_name 1 +status: ok +name of network device #1: UMKNUL0 +/> net_get_dev_name 2 +status: ok +name of network device #2: UMKNUL0 +/> net_dev_stop 0 +status: ok +/> net_dev_stop 1 +status: ok +/> net_dev_reset 0 +status: ok +/> net_dev_reset 1 +status: ok +/> net_get_dev 0 +status: ok +address of net dev #0: 0x80d12d8 +/> net_get_dev 1 +status: ok +address of net dev #1: 0x2aa8b100 +/> net_get_packet_tx_count 0 +status: ok +packet tx count of net dev #0: 0 +/> net_get_packet_tx_count 1 +status: ok +packet tx count of net dev #1: 0 +/> net_get_packet_tx_count 2 +status: ok +packet tx count of net dev #2: 0 +/> net_get_packet_rx_count 0 +status: ok +packet rx count of net dev #0: 0 +/> net_get_packet_rx_count 1 +status: ok +packet rx count of net dev #1: 0 +/> net_get_packet_rx_count 2 +status: ok +packet rx count of net dev #2: 0 +/> +/> net_get_byte_tx_count 0 +status: ok +byte tx count of net dev #0: 0 +/> net_get_byte_tx_count 1 +status: ok +byte tx count of net dev #1: 0 +/> net_get_byte_tx_count 2 +status: ok +byte tx count of net dev #2: 0 +/> net_get_byte_rx_count 0 +status: ok +byte rx count of net dev #0: 0 +/> net_get_byte_rx_count 1 +status: ok +byte rx count of net dev #1: 0 +/> net_get_byte_rx_count 2 +status: ok +byte rx count of net dev #2: 0 +/> +/> net_get_link_status 0 +status: fail +/> net_get_link_status 1 +status: ok +link status of net dev #1: 6 ETH_LINK_FD + ETH_LINK_10M +/> net_get_link_status 2 +status: ok +link status of net dev #2: 6 ETH_LINK_FD + ETH_LINK_10M diff --git a/test/022_#net_#f74_all.d b/test/022_#net_#f74_all.t similarity index 98% rename from test/022_#net_#f74_all.d rename to test/022_#net_#f74_all.t index b40e980..13b40e8 100644 --- a/test/022_#net_#f74_all.d +++ b/test/022_#net_#f74_all.t @@ -1,3 +1,4 @@ +umka_boot net_get_dev_count stack_init net_get_dev_count diff --git a/test/023_#net_#f75_all.d b/test/023_#net_#f75_all.d index adb2d6d..9e1af42 100644 --- a/test/023_#net_#f75_all.d +++ b/test/023_#net_#f75_all.d @@ -1,3 +1,4 @@ +umka_boot stack_init net_add_device net_get_dev_type 1 @@ -10,10 +11,9 @@ net_get_byte_tx_count 1 net_get_byte_rx_count 1 net_get_link_status 1 -#net_open_socket 2 1 0 -#net_bind 3 80 192.243.108.5 +#net_bind 3 80 127.0.0.1 net_open_socket 2 1 0 -net_connect 1 80 192.243.108.5 -net_accept 1 80 192.243.108.5 +net_connect 1 80 127.0.0.1 +net_accept 1 80 127.0.0.1 diff --git a/test/024_#net_#f76_all.ref.log b/test/024_#net_#f76_all.ref.log new file mode 100644 index 0000000..e5a36e2 --- /dev/null +++ b/test/024_#net_#f76_all.ref.log @@ -0,0 +1,41 @@ +/> umka_boot +/> stack_init +/> net_add_device +device number: 1 +/> net_get_dev_type 1 +status: ok +type of network device #1: 1 +/> net_get_dev_name 1 +status: ok +name of network device #1: UMKNUL0 +/> net_dev_reset 1 +status: ok +/> +/> net_eth_read_mac 1 +80:2b:f9:3b:6c:ca +/> +/> net_ipv4_set_subnet 1 0.0.0.0 +status: ok +/> net_ipv4_get_subnet 1 +0.0.0.0 +/> +/> net_ipv4_set_gw 1 192.168.1.1 +status: ok +/> net_ipv4_get_gw 1 +192.168.1.1 +/> +/> net_ipv4_set_dns 1 217.10.36.5 +status: ok +/> net_ipv4_get_dns 1 +217.10.36.5 +/> +/> net_ipv4_set_addr 1 192.168.1.27 +status: ok +/> net_ipv4_get_addr 1 +192.168.1.27 +/> +/> net_arp_get_count 1 +0 +/> net_arp_add_entry 1 192.168.1.26 80:2b:f9:3b:6c:c9 0 64 +/> net_arp_get_count 1 +1 diff --git a/test/024_#net_#f76_all.d b/test/024_#net_#f76_all.t similarity index 97% rename from test/024_#net_#f76_all.d rename to test/024_#net_#f76_all.t index d34add6..6c8cec8 100644 --- a/test/024_#net_#f76_all.d +++ b/test/024_#net_#f76_all.t @@ -1,3 +1,4 @@ +umka_boot stack_init net_add_device net_get_dev_type 1 diff --git a/test/025_#net_#arp_#f76_all.ref.log b/test/025_#net_#arp_#f76_all.ref.log new file mode 100644 index 0000000..b100531 --- /dev/null +++ b/test/025_#net_#arp_#f76_all.ref.log @@ -0,0 +1,111 @@ +/> umka_boot +/> stack_init +/> +/> net_get_dev_count +active network devices: 1 +/> +/> net_get_dev_name 0 +status: ok +name of network device #0: loopback +/> +/> net_add_device +device number: 1 +/> +/> net_get_dev_count +active network devices: 2 +/> +/> net_get_dev_name 1 +status: ok +name of network device #1: UMKNUL0 +/> +/> net_dev_reset 1 +status: ok +/> +/> net_arp_get_count 1 +0 +/> +/> net_arp_add_entry 1 192.168.1.11 01:01:01:01:01:01 2 61 +/> net_arp_get_count 1 +1 +/> net_arp_get_entry 1 0 +arp #0: IP 192.168.1.11, mac 01:01:01:01:01:01, status 2, ttl 61 +/> +/> net_arp_add_entry 1 192.168.1.12 02:02:02:02:02:02 2 62 +/> net_arp_get_count 1 +2 +/> net_arp_get_entry 1 0 +arp #0: IP 192.168.1.11, mac 01:01:01:01:01:01, status 2, ttl 61 +/> net_arp_get_entry 1 1 +arp #1: IP 192.168.1.12, mac 02:02:02:02:02:02, status 2, ttl 62 +/> +/> net_arp_add_entry 1 192.168.1.13 03:03:03:03:03:03 2 63 +/> net_arp_get_count 1 +3 +/> net_arp_get_entry 1 0 +arp #0: IP 192.168.1.11, mac 01:01:01:01:01:01, status 2, ttl 61 +/> net_arp_get_entry 1 1 +arp #1: IP 192.168.1.12, mac 02:02:02:02:02:02, status 2, ttl 62 +/> net_arp_get_entry 1 2 +arp #2: IP 192.168.1.13, mac 03:03:03:03:03:03, status 2, ttl 63 +/> +/> net_arp_del_entry 1 2 +/> net_arp_get_count 1 +2 +/> net_arp_get_entry 1 0 +arp #0: IP 192.168.1.12, mac 02:02:02:02:02:02, status 2, ttl 62 +/> net_arp_get_entry 1 1 +arp #1: IP 192.168.1.13, mac 03:03:03:03:03:03, status 2, ttl 63 +/> net_arp_get_entry 1 2 +status: fail +/> +/> net_arp_del_entry 1 1 +/> net_arp_get_count 1 +1 +/> net_arp_get_entry 1 0 +arp #0: IP 192.168.1.13, mac 03:03:03:03:03:03, status 2, ttl 63 +/> net_arp_get_entry 1 1 +status: fail +/> net_arp_get_entry 1 2 +status: fail +/> +/> net_arp_del_entry 1 10 +status: fail +/> net_arp_get_count 1 +1 +/> net_arp_get_entry 1 0 +arp #0: IP 192.168.1.13, mac 03:03:03:03:03:03, status 2, ttl 63 +/> net_arp_get_entry 1 1 +status: fail +/> net_arp_get_entry 1 2 +status: fail +/> +/> net_arp_del_entry 1 20 +status: fail +/> net_arp_get_count 1 +1 +/> net_arp_get_entry 1 0 +arp #0: IP 192.168.1.13, mac 03:03:03:03:03:03, status 2, ttl 63 +/> net_arp_get_entry 1 1 +status: fail +/> net_arp_get_entry 1 2 +status: fail +/> +/> +/> net_arp_del_entry 1 0 +/> net_arp_get_count 1 +0 +/> net_arp_get_entry 1 0 +status: fail +/> +/> net_arp_add_entry 1 192.168.1.11 01:01:01:01:01:01 2 61 +/> +/> net_arp_add_entry 1 192.168.1.12 02:02:02:02:02:02 2 62 +/> +/> net_arp_get_count 1 +2 +/> +/> net_arp_del_entry 1 -1 +status: fail +/> +/> net_arp_get_count 1 +2 diff --git a/test/025_#net_#arp_#f76_all.d b/test/025_#net_#arp_#f76_all.t similarity index 99% rename from test/025_#net_#arp_#f76_all.d rename to test/025_#net_#arp_#f76_all.t index 8cf1339..0cb0cac 100644 --- a/test/025_#net_#arp_#f76_all.d +++ b/test/025_#net_#arp_#f76_all.t @@ -1,3 +1,4 @@ +umka_boot stack_init net_get_dev_count