source: tests/00500_firewall @ 0105685

gcc484ntopperl-5.22
Last change on this file since 0105685 was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100755
File size: 3.0 KB
Line 
1#!/bin/bash
2
3
4source testlib || exit 1
5
6#### Zijn alle paginas uberhaubt opvraagbaar zonder errors?
7
8DESCRIPTION1="Basic pagina check"
9PAGE="firewall/listfirewall.php?show=input"
10VERIFYPOSITIVE="Firewall opnieuw starten"
11scc_add
12
13DESCRIPTION1="Basic pagina check"
14PAGE="firewall/listblocks.php"
15VERIFYPOSITIVE="(Alle adressen|All adresses)"
16scc_add
17
18DESCRIPTION1="Basic pagina check"
19PAGE="firewall/listservices.php"
20VERIFYPOSITIVE="(IPSEC verkeer|IPSEC traffic)"
21scc_add
22
23DESCRIPTION1="Basic pagina check"
24PAGE="firewall/listadmins.php"
25VERIFYPOSITIVE="altijd toegang tot de webinterface"
26scc_add
27
28#### Ruim oude zooi quick and dirty op
29DESCRIPTION1="Oude zooi opruimen"
30PAGE="firewall/editblock.php?name=testblok&del=1"
31IGNOREERROR=1
32scc_add
33
34DESCRIPTION1="Oude zooi opruimen"
35PAGE="firewall/editservice.php?id=1234/tcp&del=1"
36IGNOREERROR=1
37scc_add
38
39DESCRIPTION1="Oude zooi opruimen"
40PAGE="firewall/editfirewall.php?ruletxt=ipblock,testblok,zone_FW,,service,/icmp,deny,,&del=1"
41IGNOREERROR=1
42scc_add
43
44#### Voeg test blokken en services toe
45
46DESCRIPTION1="Maak testipblok aan"
47PAGE="firewall/editblock.php"
48METHOD="post"
49POSTBODY="new_name=testblok&new_startip=0.0.0.0&new_endip=255.255.255.255&save=1"
50VERIFYPOSITIVE="testblok gewijzigd"
51scc_add
52
53DESCRIPTION1="controleer testblok"
54PAGE="firewall/listblocks.php"
55VERIFYPOSITIVE="testblok"
56scc_add
57
58DESCRIPTION1="Maak testservice aan"
59PAGE="firewall/editservice.php"
60METHOD="post"
61POSTBODY="fields[port]=1234&fields[proto]=tcp&fields[desc]=testservice&save=1"
62VERIFYPOSITIVE="Service definitie 1234/tcp gewijzigd"
63scc_add
64
65
66DESCRIPTION1="controleer testservice"
67PAGE="firewall/listservices.php"
68VERIFYPOSITIVE="testservice"
69scc_add
70
71#Voer de set tot zo ver uit:
72scc_test  || exit 1
73
74#### Test of firewall daadwerkelijk 'effect' heeft
75
76scc_new
77DESCRIPTION1="Maak icmp allow regel aan"
78PAGE="firewall/editfirewall.php"
79METHOD="post"
80POSTBODY="new_dstserviceandtype=service!/icmp&new_access=allow&new_dsttype=zone_FW&new_src=testblok&new_srctype=ipblock&save=1"
81VERIFYPOSITIVE="toegevoegd"
82scc_add
83scc_test  || exit 1
84
85DESCRIPTION1="Onthoud firewall regel ID"
86CMD="cat /etc/firewall/firewall|cut -f 3 -d' '|grep  '[0-9]'|tail -1";
87ID=`sshtest` || exit 1
88
89echo "Kunnen we server pingen?"
90ping -w1 -c1 $IP || exit 1
91
92scc_new
93DESCRIPTION1="Verander allow in deny regel"
94PAGE="firewall/editfirewall.php?ruletxt=$ID"
95METHOD="post"
96POSTBODY="new_dstserviceandtype=service!/icmp&new_access=deny&new_dsttype=zone_FW&new_src=testblok&new_srctype=ipblock&save=1"
97VERIFYPOSITIVE="veranderd in"
98scc_add
99scc_test  || exit 1
100
101
102echo "Server mag nu niet meer pingbaar zijn:"
103ping -w1 -c1 $IP && exit 1
104
105
106#### Ruim oude zooi quick and dirty op
107scc_new
108
109DESCRIPTION1="Oude zooi opruimen"
110PAGE="firewall/editblock.php?name=testblok&del=1"
111IGNOREERROR=1
112scc_add
113
114DESCRIPTION1="Oude zooi opruimen"
115PAGE="firewall/editfirewall.php?ruletxt=$ID&del=1"
116IGNOREERROR=1
117scc_add
118
119DESCRIPTION1="Oude zooi opruimen"
120PAGE="firewall/editservice.php?id=1234/tcp&del=1"
121IGNOREERROR=1
122scc_add
123
124
125scc_test || exit 1
Note: See TracBrowser for help on using the repository browser.