-
Notifications
You must be signed in to change notification settings - Fork 0
/
test06.sh
43 lines (31 loc) · 1.4 KB
/
test06.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_nocheck) with NO checks at user level
echo dummy test > infile
echo "" >> results
echo "" >> log
echo test06.sh: Negative testcase : Wrong password during decryption>> results
echo test06.sh: Negative testcase : Wrong password during decryption>> log
echo ./xcpenc_nocheck -e -p password infile encryptfile >> results
echo ./xcpenc_nocheck -e -p password infile encryptfile >> log
./xcpenc_nocheck -e -p "password" infile encryptfile >> log
retval=$?
if test $retval != 0 ; then
echo encryption: xcpenc_nocheck failed with error: $retval >> results
else
echo encryption: xcpenc_nocheck program succeeded >> results
fi
echo "" >> results
echo "" >> log
echo ./xcpenc_nocheck -d -p password123 encryptfile decryptfile >> results
echo ./xcpenc_nocheck -d -p password123 encryptfile decryptfile >> log
./xcpenc_nocheck -d -p "password123" encryptfile decryptfile >> log
retval=$?
if test $retval != 0 ; then
echo decryption: xcpenc_nocheck failed with error: $retval >> results
else
echo decryption: xcpenc_nocheck program succeeded >> results
fi
echo "------------------------------------------------------------------------------" >> results
echo "------------------------------------------------------------------------------" >> log