updated hmacmd5test script to change save location and convert \n to \r\n

This commit is contained in:
Patrick Kloepfer 2021-07-27 08:01:35 -04:00
parent ef3398214f
commit f8b8e13285
1 changed files with 39 additions and 39 deletions

View File

@ -1,39 +1,39 @@
NEW NEW
PREFIX PREFIX
AUTO 4,1 AUTO 4,1
#!/BIN/SH #!/BIN/SH
# #
# This script tests the HMAC-MD5 command to make # This script tests the HMAC-MD5 command to make
# sure it is properly generating and returning # sure it is properly generating and returning
# correct MD5 values. # correct MD5 values.
# #
# This test uses the SET var = `command` directive, # This test uses the SET var = `command` directive,
# testing that facility as well. # testing that facility as well.
# #
SET TestPhrase = "Hello World" SET TestPhrase = "Hello World"
SET TestKey = "Super Secret Key" SET TestKey = "Super Secret Key"
SET CorrectValue = "41E1F2EE77BA4551318745CE12A4A6A4" SET CorrectValue = "41E1F2EE77BA4551318745CE12A4A6A4"
ECHO "\f\n HMAC-MD5 Test" ECHO "\f\n HMAC-MD5 Test"
ECHO "\n\nThis script tests the HMAC-MD5 command to make" ECHO "\n\nThis script tests the HMAC-MD5 command to make"
ECHO "sure it is properly generating and returning" ECHO "sure it is properly generating and returning"
ECHO "correct HMAC-MD5 values.\n\n" ECHO "correct HMAC-MD5 values.\n\n"
SET Result = `HMACMD5 -D "$TestPhrase" -K "$TestKey"` SET Result = `HMACMD5 -D "$TestPhrase" -K "$TestKey"`
IF [ $Result = $CorrectValue ] IF [ $Result = $CorrectValue ]
ECHO "This Test Passed" ECHO "This Test Passed"
IF [ -N $Log ] IF [ -N $Log ]
SET T = $T + 1 SET T = $T + 1
SET P = $P + 1 SET P = $P + 1
ECHO "HMACMD5 Test Passed" >> ${Log} ECHO "HMACMD5 Test Passed" >> ${Log}
FI FI
ELSE ELSE
ECHO "This Test Failed" ECHO "This Test Failed"
ECHO "The returned result was: $Result" ECHO "The returned result was: $Result"
IF [ -N $Log ] IF [ -N $Log ]
SET T = $T + 1 SET T = $T + 1
SET F = $F + 1 SET F = $F + 1
ECHO "HMACMD5 Test Failed" >> ${Log} ECHO "HMACMD5 Test Failed" >> ${Log}
FI FI
FI FI
echo \n\n echo \n\n
MAN MAN
TEXT root/HMACMD5TEST TEXT /MAKE/USR/SHARE/TESTS/HMACMD5TEST