-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-tests.sh
152 lines (122 loc) · 3.37 KB
/
run-tests.sh
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
#!/bin/bash
# Set server and port
SERVER="localhost"
PORT="5128"
# Test --create
echo "Testing --create"
CREATE_OUTPUT=$(java -cp .:lib/* IdClient --server $SERVER --numport $PORT --create AlexL Alex --password password123)
echo "CREATE_OUTPUT"
echo "Extracted UUID: $CREATE_OUTPUT"
echo "------------------------------------------"
echo
echo
echo
sleep 2
# Test --create with no real name specified
echo "Test --create with no real name specified"
CREATE_OUTPUT=$(java -cp .:lib/* IdClient --server $SERVER --numport $PORT --create kai --password pass)
echo "$CREATE_OUTPUT"
echo "------------------------------------------"
echo
echo
echo
sleep 2
# Test --create with no password specified
echo "Test --create with no password specified"
CREATE_OUTPUT=$(java -cp .:lib/* IdClient --server $SERVER --numport $PORT --create Amit "Amit Jain")
echo "$CREATE_OUTPUT"
echo "------------------------------------------"
echo
echo
echo
sleep 2
# Test --create with name that is already used
echo "Test --create with name that is already used"
CREATE_OUTPUT=$(java -cp .:lib/* IdClient --server $SERVER --numport $PORT --create AlexL Alex)
echo "$CREATE_OUTPUT"
echo "------------------------------------------"
echo
echo
echo
sleep 2
# Test --lookup
echo "Testing --lookup"
java -cp .:lib/* IdClient --server $SERVER --numport $PORT --lookup AlexL
echo "------------------------------------------"
echo
echo
echo
sleep 2
# Test --get users
echo "Testing --get users"
java -cp .:lib/* IdClient --server $SERVER --numport $PORT --get users
echo "------------------------------------------"
echo
echo
echo
sleep 2
# Test --get uuids
echo "Testing --get uuids"
java -cp .:lib/* IdClient --server $SERVER --numport $PORT --get uuids
echo "------------------------------------------"
echo
echo
echo
sleep 2
# Test --get all
echo "Testing --get all"
java -cp .:lib/* IdClient --server $SERVER --numport $PORT --get all
echo "------------------------------------------"
echo
echo
echo
sleep 2
# Test --reverse-lookup with the extracted UUID
# echo "Testing --reverse-lookup with extracted UUID"
# java -cp .:lib/* IdClient --server $SERVER --numport $PORT --reverse-lookup $UUID
# echo "------------------------------------------"
# sleep 2
# Test --modify with password
echo "Testing --modify with password"
java -cp .:lib/* IdClient --server $SERVER --numport $PORT --modify AlexL ALEX --password "password123"
echo "------------------------------------------"
echo
echo
echo
sleep 2
# Test --modify with no password
echo "Testing --modify with no password"
java -cp .:lib/* IdClient --server $SERVER --numport $PORT --modify Amit amit
echo "------------------------------------------"
echo
echo
echo
sleep 2
# Test --modify with name that already exists
echo "Testing --modify with name that already exists"
java -cp .:lib/* IdClient --server $SERVER --numport $PORT --modify amit kai
echo "------------------------------------------"
echo
echo
echo
sleep 2
# Test --delete no pass
echo "Testing --delete no password"
java -cp .:lib/* IdClient --server $SERVER --numport $PORT --delete amit
echo "------------------------------------------"
echo
echo
echo
sleep 2
# Test --delete with password
echo "Testing --delete with password"
java -cp .:lib/* IdClient --server $SERVER --numport $PORT --delete kai -password pass
echo "------------------------------------------"
echo
echo
echo
sleep 2
echo
echo
echo
echo "Testing Completed"