-
Notifications
You must be signed in to change notification settings - Fork 1
/
tests-cp1.txt
44 lines (36 loc) · 2.04 KB
/
tests-cp1.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Test Case 1: Test with SIGPIPE
Description: This test case tests the server's ability to handle with SIGPIPE.
In this test case, the client close the connection right before the server
calls send() to send data back.
-------------------------------------------------------------------------------
1. Run lisod inside gdb, before running, set a breakpoint at function io_send.
2. Use netcat to send arbitrary data to Liso server.
3. At this point, the breakpoint should be hit. Without continueing lisod,
terminate netcat.
4. Continue running lisod and it will try to send data to an already closed
socket and a SIGPIPE will be generated. See if the server terminates when
receiving SIGPIPE.
*******************************************************************************
Test Case 2: Test with Large Data
Decription: Use large_data.py to send very large data to server.
-------------------------------------------------------------------------------
large_data.py:
1. Send specific size of data to the server.
2. With 50% probabiltiy, close the connection immdiately after sending data.
And with 50% probability, receive a random amount of data from the server.
The purpose of this is to make the connection abnormal.
3. Established a new connection to the server.
4. Send and receive data to verify the correctness of echo server.
*******************************************************************************
Test Case 3: Test Linked list
Decription: The server uses linked list to maintain client sockets, the purpose
of this test case is to see whether the linked list operate correctly.
-------------------------------------------------------------------------------
linked_list.py:
1. Establish serveral connections to the server.
2. Close those connections in random order.
*******************************************************************************
Test Case 4: Memory Leak
Use valgrind to check if there's memory leak
-------------------------------------------------------------------------------
valgrind --tool=memcheck --leak-check=yes ./lisod <port>