From 48cc17ac0a7622c3bacc109e34ed8d5ff58a3690 Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Mon, 29 May 2017 19:31:26 -0400 Subject: [PATCH] "make test" now uses "expect" to not prompt for passwords. --- Makefile | 3 +-- tools/auto_system_test | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100755 tools/auto_system_test diff --git a/Makefile b/Makefile index 1d973ee..645cf86 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/tools/auto_system_test b/tools/auto_system_test new file mode 100755 index 0000000..eefc38c --- /dev/null +++ b/tools/auto_system_test @@ -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]; +}