Usermode/libc - Fix strchr and strrchr behavior
[tpg/acess2.git] / Tools / NetTest_Runner / test_arp.c
1 /*
2  */
3 #include "test.h"
4 #include "tests.h"
5 #include "net.h"
6 #include "stack.h"
7 #include "arp.h"
8
9 static const int        ERX_TIMEOUT = 1000;     // Expect RX timeout (timeout=failure)
10 static const int        NRX_TIMEOUT = 250;      // Not expect RX timeout (timeout=success)
11
12 bool Test_ARP_Basic(void)
13 {
14         TEST_HEADER;
15         
16         // Request test machine's IP
17         ARP_SendRequest(0, BLOB(TEST_IP));
18         TEST_ASSERT_rx();
19         TEST_ASSERT( ARP_Pkt_IsResponse(rxlen, rxbuf, BLOB(TEST_IP), BLOB(TEST_MAC)) );
20
21         // Request host machine's IP
22         ARP_SendRequest(0, BLOB(HOST_IP));
23         TEST_ASSERT_no_rx();
24
25         #if 0   
26         // Ask test machine to request our IP
27         Stack_SendCommand("arprequest "HOST_IP_STR);
28         TEST_ASSERT_rx();
29         TEST_ASSERT( ARP_Pkt_IsRequest(rxlen, rxbuf, HOST_IP) );
30
31         // Respond
32         ARP_SendResponse(0, HOST_IP, HOST_MAC);
33         
34         // Ask test machine to request our IP again (expecting nothing)
35         Stack_SendCommand("arprequest "HOST_IP_STR);
36         TEST_ASSERT_no_rx();
37         #endif
38         
39         return true;
40 }

UCC git Repository :: git.ucc.asn.au