-
Notifications
You must be signed in to change notification settings - Fork 0
/
eggdrop_console_flags.bats
152 lines (123 loc) · 4.41 KB
/
eggdrop_console_flags.bats
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
@test "Eggdrop setup" {
export PASS
run cp $WORK_DIR/tests/eggdrop_console_flags.* $HOME/eggdrop/
echo $output
[ $status -eq 0 ]
run cp $WORK_DIR/tests/cmd_accept.tcl $HOME/eggdrop/scripts/
[ $status -eq 0 ]
cd $HOME/eggdrop
run ./eggdrop eggdrop_console_flags.conf 3>&-
echo $output
[ $status -eq 0 ]
run bash -c 'echo "{adduser testuser1}" |nc localhost 45678'
[[ "$output" == *"{1}"* ]]
run bash -c 'echo "{adduser testuser2}" |nc localhost 45678'
[[ "$output" == *"{1}"* ]]
run bash -c 'echo "{setuser testuser1 PASS eggdrop}" |nc localhost 45678'
[[ "$output" == "0"* ]]
run bash -c 'echo "{setuser testuser2 PASS eggdrop}" |nc localhost 45678'
[[ "$output" == "0"* ]]
run bash -c 'echo "{chattr testuser1 +n}" |nc localhost 45678'
[[ "$output" == *"jlmnoptx"* ]]
run bash -c 'echo "{chattr testuser2 +n}" |nc localhost 45678'
[[ "$output" == *"jlmnoptx"* ]]
}
@test "Eggdrop sets default console flags from config" {
run bash -c '{ echo "testuser1"; echo "$PASS"; echo ".console"; sleep 1; } | telnet localhost 3015'
CON=${output##*Your console is}
echo $CON
[[ "$CON" == *" mcobx "* ]]
}
@test "Eggdrop sets console flags" {
run bash -c '{ echo "testuser1"; echo "$PASS"; echo ".console +d"; sleep 1; } | telnet localhost 3015'
CON=${output##*Set your console to}
echo $CON
[[ "$CON" == *" mcobxd "* ]]
}
@test "Eggdrop removes console flags" {
run bash -c '{ echo "testuser1"; echo "$PASS"; echo ".console -d"; sleep 1; } | telnet localhost 3015'
CON=${output##*Set your console to}
echo $CON
[[ "$CON" == *" mcobx "* ]]
}
@test "Eggdrop disallows adding invalid console flags" {
run bash -c '{ echo "testuser1"; echo "$PASS"; echo ".console +z"; sleep 1; } | telnet localhost 3015'
CON=${output##*Set your console to}
echo $CON
[[ "$CON" == *" mcobx "* ]]
}
@test "Eggdrop ignores removing invalid console flags" {
run bash -c '{ echo "testuser1"; echo "$PASS"; echo ".console -z"; sleep 1; } | telnet localhost 3015'
CON=${output##*Set your console to}
echo $CON
[[ "$CON" == *" mcobx "* ]]
}
@test "Eggdrop ignores adding already-set console flags" {
run bash -c '{ echo "testuser1"; echo "$PASS"; echo ".console +m"; sleep 1; } | telnet localhost 3015'
CON=${output##*Set your console to}
echo $CON
[[ "$CON" == *" mcobx "* ]]
}
@test "Eggdrop ignores removing non-set console flags" {
run bash -c '{ echo "testuser1"; echo "$PASS"; echo ".console -d"; sleep 1; } | telnet localhost 3015'
CON=${output##*Set your console to}
echo $CON
[[ "$CON" == *" mcobx "* ]]
}
@test "Eggdrop sets console flags and changes channel view" {
run bash -c '{ echo "testuser1"; echo "$PASS"; echo ".console #testegg +d"; sleep 1; } | telnet localhost 3015'
CON=${output##*Set your console to}
echo $CON
[[ "$CON" == *"#testegg: mcobxd "* ]]
}
@test "Eggdrop removes console flags and changes channel view" {
run bash -c '{ echo "testuser1"; echo "$PASS"; echo ".console * -d"; sleep 1; } | telnet localhost 3015'
CON=${output##*Set your console to}
echo $CON
[[ "$CON" == *"*: mcobx "* ]]
}
@test "Eggdrop changes channel view" {
run bash -c '{ echo "testuser1"; echo "$PASS"; echo ".console #testegg"; sleep 1; } | telnet localhost 3015'
CON=${output##*Set your console to}
echo $CON
[[ "$CON" == *"#testegg: mcobx "* ]]
}
@test "Eggdrop shows console for other user" {
skip
}
@test "Eggdrop sets console flags for other user" {
skip
}
@test "Eggdrop removes console flags for other user" {
skip
}
@test "Eggdrop sets console flags and changes channel view for other user" {
skip
}
@test "Eggdrop removes console flags and changes channel view for other user" {
skip
}
@test "Eggdrop changes channel view for other user" {
skip
}
@test "Eggdrop .resetconsole resets to config default (on channel)" {
skip
run bash -c '{ echo "testuser1"; echo "$PASS"; echo ".console #testegg +d"; echo ".resetconsole"; sleep 1; } | telnet localhost 3015'
CON=${output##*Set your console to}
[[ "$CON" == *"*: mcobx "* ]]
}
@test "Eggdrop .resetconsole resets to config defaults (on *)" {
skip
run bash -c '{ echo "testuser1"; echo "$PASS"; echo ".console * +d"; echo ".resetconsole"; sleep 1; } | telnet localhost 3015'
CON=${output##*Set your console to}
[[ "$CON" == *"*: mcobx "* ]]
}
@test "Kill Eggdrop" {
ps x|grep "[e]ggdrop "
if [ $? -eq 0 ]; then
pkill eggdrop
fi
if [ -e $HOME/eggdrop/tempuser.user ]; then
rm $HOME/eggdrop/tempsuer.user
fi
}