"make test" now uses "expect" to not prompt for passwords.

This commit is contained in:
Tom Limoncelli
2017-05-29 19:31:26 -04:00
parent d78faf59d0
commit 48cc17ac0a
2 changed files with 15 additions and 2 deletions

View File

@@ -127,7 +127,6 @@ test: confidence
confidence:
@if [ -e ~/.gnupg ]; then echo ERROR: '~/.gnupg should not exist. If it does, bugs may polute your .gnupg configuration. If the code has no bugs everything will be fine. Do you feel lucky?'; false ; fi
@if which >/dev/null gpg-agent ; then pkill gpg-agent ; rm -rf /tmp/tmp.* ; fi
@export PATH="$(PWD)/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/local/bin:$(PATH)" ; tools/confidence_test.sh
tools/confidence_test.sh
@export PATH="$(PWD)/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/local/bin:$(PATH)" ; tools/auto_system_test
@if which >/dev/null gpg-agent ; then pkill gpg-agent ; fi
@if [ -e ~/.gnupg ]; then echo ERROR: '~/.gnupg was created which means the scripts might be poluting GnuPG configuration. Fix this bug.'; false ; fi

14
tools/auto_system_test Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env expect
spawn tools/confidence_test.sh
set times 0;
while { $times < 300 } {
expect {
"my password is the lowercase letter a" { set pw "a\n" ; exp_continue }
"my password is the lowercase letter b" { set pw "b\n" ; exp_continue }
"Passphrase:" { send $pw ; exp_continue }
eof { break }
}
set times [ expr $times+1];
}