Skip to content

Commit

Permalink
Add 2 nagtive test case, remove single quote and double quote
Browse files Browse the repository at this point in the history
  • Loading branch information
JibinBao committed May 18, 2022
1 parent 2f982b2 commit 12f541e
Showing 1 changed file with 48 additions and 22 deletions.
70 changes: 48 additions & 22 deletions doc/syslog/Syslog_Source_IP_test_plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The tests will be supported on any topo.
### Test cases #1 - Configure syslog server with VRF/Source:unset/unset
1. Configure syslog server with VRF/Source:unset/unset like below:
```
config syslog add '2.2.2.2'
config syslog add 2.2.2.2
```
2. Check syslog config by show syslog, the result should like below:
```
Expand All @@ -64,7 +64,7 @@ SERVER SOURCE PORT VRF
3. Check the corresponding interface will send syslog message with port 514 on dut
4. Del syslog server config like below:
```
config syslog del '2.2.2.2'
config syslog del 2.2.2.2
```
5. Check syslog config by show syslog, the relevant config should be removed
6. Check the corresponding interface will not send syslog message with port 514 on dut
Expand All @@ -74,7 +74,7 @@ config syslog del '2.2.2.2'
### Test cases #2 - Configure syslog server with VRF/Source: unset/set
1. Configure syslog server with VRF/Source: unset/set like below:
```
config syslog add '2.2.2.2' --source "1.1.1.1"
config syslog add 2.2.2.2 --source 1.1.1.1
```
2. Check syslog config by show syslog, the result should like below:
```
Expand All @@ -86,7 +86,7 @@ SERVER SOURCE PORT VRF
3. Check the corresponding interface will send syslog message with port 514 and src ip 1.1.1.1 on dut
4. Del syslog server config like below:
```
config syslog del '2.2.2.2'
config syslog del 2.2.2.2
```
5. Check syslog config by show syslog, the relevant config should be removed
6. Check the corresponding interface will not send syslog message with port 514 and src ip 1.1.1.1 on dut
Expand All @@ -96,9 +96,9 @@ config syslog del '2.2.2.2'
### Test cases #3 - Configure syslog server with VRF/Source: set/unset
1. For vrf: default, mgmt, Vrf-data, Configure syslog server with VRF/Source: set/unset like below:
```
config syslog add '2.2.2.2' --vrf "default"
config syslog add '3.3.3.3' --vrf "mgmt"
config syslog add '2222::2222' --vrf "Vrf-data"
config syslog add 2.2.2.2 --vrf default
config syslog add 3.3.3.3 --vrf mgmt
config syslog add 2222::2222 --vrf Vrf-data
```
2. Check syslog config by show syslog, the result should like below:
```
Expand All @@ -112,9 +112,9 @@ SERVER SOURCE PORT VRF
3. Check the corresponding interface will send syslog message with port 514 on dut
4. Del syslog server config like below:
```
config syslog del '2.2.2.2'
config syslog del '3.3.3.3'
config syslog del '2222::2222'
config syslog del 2.2.2.2
config syslog del 3.3.3.3
config syslog del 2222::2222
```
5. Check syslog config by show syslog, the relevant config should be removed
6. Check the corresponding interface will not send syslog message with port 514 on dut
Expand All @@ -124,9 +124,9 @@ config syslog del '2222::2222'
### Test cases #4 - Configure syslog server with VRF/Source: set/set
1. For vrf: default, mgmt, Vrf-data, Configure syslog server with VRF/Source: set/set like below:
```
config syslog add '2.2.2.2' ---source "1.1.1.1" --vrf "default"
config syslog add '3.3.3.3' ---source "5.5.5.5" --vrf "mgmt"
config syslog add '2222::2222' ---source "1111::1111" --vrf "Vrf-data"
config syslog add 2.2.2.2 ---source 1.1.1.1 --vrf default
config syslog add 3.3.3.3 ---source 5.5.5.5 --vrf mgmt
config syslog add 2222::2222 ---source 1111::1111 --vrf Vrf-data
```
2. Check syslog config by show syslog, the result should like below:
```
Expand All @@ -140,9 +140,9 @@ SERVER SOURCE PORT VRF
3. Check the corresponding interface will send syslog message with port 514 and related source IP on dut
4. Del syslog server config like below:
```
config syslog del '2.2.2.2'
config syslog del '3.3.3.3'
config syslog del '2222::2222'
config syslog del 2.2.2.2
config syslog del 3.3.3.3
config syslog del 2222::2222
```
5. Check syslog config by show syslog, the relevant config should be removed
6. Check the corresponding interface will not send any syslog message with related port and source ip
Expand All @@ -152,8 +152,8 @@ config syslog del '2222::2222'
### Test cases #5 - Disable mgmt VRF or remove data VRF exists in syslog config, there will be an error prompt
1. Configure syslog sever with VRF/Source: set/set like below:
```
config syslog add '3.3.3.3' ---source "5.5.5.5" --vrf "mgmt"
config syslog add '2222::2222' ---source "1111::1111" --vrf "Vrf-data"
config syslog add 3.3.3.3 --source 5.5.5.5 --vrf mgmt
config syslog add 2222::2222 --source 1111::1111 --vrf Vrf-data
```
2. Check syslog config by show syslog, the result should like below:
```
Expand All @@ -166,12 +166,13 @@ SERVER SOURCE PORT VRF
3. Disable mgmt VRF or remove Data VRF
4. Check there is an error prompt such as: VRF exists in syslog config, it can not be disabled or removed.


### Test cases #6 - After Configure syslog server and save config, do cold/fast/warm reboot, check syslog config still work
1. Configure syslog server with VRF/Source: set/set like below:
```
config syslog add '2.2.2.2' ---source "1.1.1.1" --vrf "default"
config syslog add '3.3.3.3' ---source "5.5.5.5" --vrf "mgmt"
config syslog add '2222::2222' ---source "1111::1111" --vrf "Vrf-data"
config syslog add 2.2.2.2 --source 1.1.1.1 --vrf default
config syslog add 3.3.3.3 --source 5.5.5.5 --vrf mgmt
config syslog add 2222::2222 --source 1111::1111 --vrf Vrf-data
```
2. Check syslog config by show syslog, the result should like below:
```
Expand All @@ -184,4 +185,29 @@ SERVER SOURCE PORT VRF
```
3. Check the corresponding interface will send syslog message with port 514 and related source IP on dut
4. Save config and do cold/fast/warm reboot
5. Check Syslog config still work
5. Check Syslog config still work


### Test cases #7 - Configure syslog server with invalid source IP
1. Configure syslog server with invalid IP:
```
config syslog add 2.2.2.2 ---source 127.0.0.1
```
2. Check there is relevant error prompt like blow
```
Error: Invalid value for "-s" / "--source": 127.0.0.1 is a loopback/multicast IP address
```
3. Check the syslog config doesn't include relevant item
4. Repeat step 1~3 with non-existing IP and multicast IP


### Test cases #8 - Configure syslog server with non-existing vrf
1. Configure syslog server with non-existing vrf:
```
config syslog add 2222::2222 --vrf vrf-non
```
2. Check there is relevant error prompt like blow
```
Error: Invalid value for "-r" / "--vrf": invalid choice: vrf-non. (choose from default, Vrf-red)
```
3. Check the syslog config doesn't include relevant item

0 comments on commit 12f541e

Please sign in to comment.