-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest05.sh
43 lines (31 loc) · 1.3 KB
/
test05.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
#!/bin/sh
# This is a NEGATIVE testcase when wrong password is passed during
# decryption and it should fail with permission denied. This run
# user program (xcpenc) with all checks
echo dummy test > infile
echo "" >> results
echo "" >> log
echo test05.sh: Negative testcase Wrong password during decryption >> results
echo test05.sh: Negative testcase Wrong password during decryption >> log
echo ./xcpenc -e -p password infile encryptfile >> results
echo ./xcpenc -e -p password infile encryptfile >> log
./xcpenc -e -p "password" infile encryptfile >> log
retval=$?
if test $retval != 0 ; then
echo encryption: xcpenc failed with error: $retval >> results
else
echo encryption: xcpenc program succeeded >> results
fi
echo "" >> results
echo "" >> log
echo ./xcpenc -d -p password123 encryptfile decryptfile >> results
echo ./xcpenc -d -p password123 encryptfile decryptfile >> log
./xcpenc -d -p "password123" encryptfile decryptfile >> log
retval=$?
if test $retval != 0 ; then
echo decryption: xcpenc failed with error: $retval >> results
else
echo decryption: xcpenc program succeeded >> results
fi
echo "------------------------------------------------------------------------------" >> results
echo "------------------------------------------------------------------------------" >> log