Home | History | Annotate | Line # | Download | only in dist
tst revision 1.16
      1   1.1  agc #! /bin/sh
      2   1.1  agc 
      3  1.13  agc while [ $# -gt 0 ]; do
      4  1.13  agc 	case "$1" in
      5  1.13  agc 	-v)
      6  1.13  agc 		set -x
      7  1.13  agc 		;;
      8  1.13  agc 	*)
      9  1.13  agc 		break
     10  1.13  agc 		;;
     11  1.13  agc 	esac
     12  1.13  agc 	shift
     13  1.13  agc done
     14  1.13  agc 
     15   1.2  agc env USETOOLS=no MAKEOBJDIRPREFIX=/usr/obj/i386 sh -c 'cd ../lib && \
     16   1.2  agc 	make cleandir ; \
     17  1.13  agc 	su root -c "make includes"; \
     18   1.2  agc 	make ; \
     19   1.2  agc 	su root -c "make install"'
     20   1.8  agc env USETOOLS=no MAKEOBJDIRPREFIX=/usr/obj/i386 sh -c 'cd ../netpgp && \
     21   1.8  agc 	make cleandir ; \
     22   1.8  agc 	make ; \
     23   1.8  agc 	su root -c "make install"'
     24  1.11  agc env USETOOLS=no MAKEOBJDIRPREFIX=/usr/obj/i386 sh -c 'cd ../netpgpkeys && \
     25  1.11  agc 	make cleandir ; \
     26  1.11  agc 	make ; \
     27  1.11  agc 	su root -c "make install"'
     28   1.8  agc env USETOOLS=no MAKEOBJDIRPREFIX=/usr/obj/i386 sh -c 'cd ../netpgpverify && \
     29   1.2  agc 	make cleandir ; \
     30   1.2  agc 	make ; \
     31   1.2  agc 	su root -c "make install"'
     32   1.6  agc 
     33   1.6  agc passed=0
     34  1.15  agc total=25
     35   1.1  agc echo "======> sign/verify 180938 file"
     36   1.1  agc cp configure a
     37   1.2  agc /usr/bin/netpgp --sign a
     38   1.6  agc /usr/bin/netpgp --verify a.gpg && passed=$(expr $passed + 1)
     39   1.1  agc echo "======> attempt to verify an unsigned file"
     40   1.6  agc /usr/bin/netpgp --verify a || passed=$(expr $passed + 1)
     41   1.1  agc echo "======> encrypt/decrypt 10809 file"
     42  1.10  agc cp src/netpgp/netpgp.1 b
     43   1.2  agc /usr/bin/netpgp --encrypt b
     44   1.2  agc /usr/bin/netpgp --decrypt b.gpg
     45  1.10  agc diff src/netpgp/netpgp.1 b && passed=$(expr $passed + 1)
     46   1.1  agc echo "======> encrypt/decrypt 180938 file"
     47   1.1  agc cp configure c
     48   1.2  agc /usr/bin/netpgp --encrypt c
     49   1.2  agc /usr/bin/netpgp --decrypt c.gpg
     50   1.6  agc diff configure c && passed=$(expr $passed + 1)
     51   1.1  agc echo "======> encrypt/decrypt bigass file"
     52   1.1  agc cat configure configure configure configure configure configure > d
     53   1.1  agc ls -l d
     54   1.1  agc cp d e
     55   1.2  agc /usr/bin/netpgp --encrypt d
     56   1.2  agc /usr/bin/netpgp --decrypt d.gpg
     57   1.6  agc diff e d && passed=$(expr $passed + 1)
     58   1.3  agc echo "======> sign/verify detached signature file"
     59   1.3  agc cat configure configure configure configure configure configure > f
     60   1.3  agc /usr/bin/netpgp --sign --detached f
     61   1.3  agc ls -l f f.sig
     62   1.6  agc /usr/bin/netpgp --verify f.sig && passed=$(expr $passed + 1)
     63   1.4  agc echo "======> cat signature - verified cat command"
     64   1.4  agc /usr/bin/netpgp --cat a.gpg > a2
     65   1.6  agc diff a a2 && passed=$(expr $passed + 1)
     66   1.4  agc echo "======> another cat signature - verified cat command"
     67   1.4  agc /usr/bin/netpgp --cat --output=a3 a.gpg
     68   1.6  agc diff a a3 && passed=$(expr $passed + 1)
     69   1.8  agc echo "======> netpgp list-packets test"
     70   1.8  agc /usr/bin/netpgp --list-packets || passed=$(expr $passed + 1)
     71   1.1  agc echo "======> version information"
     72   1.2  agc /usr/bin/netpgp --version
     73   1.8  agc echo "======> netpgpverify file"
     74   1.8  agc /usr/bin/netpgpverify a.gpg && passed=$(expr $passed + 1)
     75   1.8  agc echo "======> attempt to verify an unsigned file"
     76   1.8  agc /usr/bin/netpgpverify a || passed=$(expr $passed + 1)
     77   1.8  agc echo "======> sign/verify detached signature file"
     78   1.8  agc ls -l f f.sig
     79   1.8  agc /usr/bin/netpgpverify f.sig && passed=$(expr $passed + 1)
     80   1.8  agc echo "======> another verify signature - verified cat command"
     81   1.8  agc /usr/bin/netpgpverify --output=a3 a.gpg
     82   1.8  agc diff a a3 && passed=$(expr $passed + 1)
     83  1.11  agc echo "======> list keys"
     84  1.11  agc /usr/bin/netpgpkeys --list-keys && passed=$(expr $passed + 1)
     85  1.12  agc echo "======> null file to verify"
     86  1.12  agc /usr/bin/netpgp --verify || passed=$(expr $passed + 1)
     87  1.12  agc echo "======> null file to sign"
     88  1.12  agc /usr/bin/netpgp --sign || passed=$(expr $passed + 1)
     89  1.12  agc echo "======> null file to encrypt"
     90  1.12  agc /usr/bin/netpgp --encrypt || passed=$(expr $passed + 1)
     91  1.12  agc echo "======> null file to decrypt"
     92  1.12  agc /usr/bin/netpgp --decrypt || passed=$(expr $passed + 1)
     93   1.8  agc echo "======> version information"
     94   1.8  agc /usr/bin/netpgpverify --version
     95  1.13  agc echo "======> find specific key information"
     96  1.13  agc /usr/bin/netpgpkeys --get-key c0596823 agc@netbsd.org && passed=$(expr $passed + 1)
     97  1.14  agc echo "======> ascii armoured signature"
     98  1.14  agc cp Makefile.am g
     99  1.14  agc /usr/bin/netpgp --sign --armor g && passed=$(expr $passed + 1)
    100  1.14  agc echo "======> ascii armoured sig detection and verification"
    101  1.14  agc /usr/bin/netpgp --verify g.asc && passed=$(expr $passed + 1)
    102  1.14  agc echo "======> ascii armoured signature of large file"
    103  1.14  agc cp Makefile.in g
    104  1.14  agc /usr/bin/netpgp --sign --armor g && passed=$(expr $passed + 1)
    105  1.14  agc echo "======> ascii armoured sig detection and verification of large file"
    106  1.14  agc /usr/bin/netpgp --verify g.asc && passed=$(expr $passed + 1)
    107  1.15  agc echo "======> list ssh host RSA public key"
    108  1.16  agc /usr/bin/netpgpkeys --ssh-keys --sshkeyfile=/etc/ssh/ssh_host_rsa_key.pub --list-keys && passed=$(expr $passed + 1)
    109  1.15  agc echo "======> sign/verify file with ssh host keys"
    110  1.15  agc cp configure a
    111  1.16  agc sudo /usr/bin/netpgp --ssh-keys --sshkeyfile=/etc/ssh/ssh_host_rsa_key.pub --sign a
    112  1.15  agc sudo chmod 644 a.gpg
    113  1.16  agc /usr/bin/netpgp --verify --ssh-keys --sshkeyfile=/etc/ssh/ssh_host_rsa_key.pub a.gpg && passed=$(expr $passed + 1)
    114  1.14  agc rm -f a a.gpg b b.gpg c c.gpg d d.gpg e f f.sig g g.asc a2 a3
    115   1.6  agc echo "Passed ${passed}/${total} tests"
    116