diff options
author | gramanas <anastasis.gramm2@gmail.com> | 2018-11-19 19:11:06 +0200 |
---|---|---|
committer | gramanas <anastasis.gramm2@gmail.com> | 2018-11-19 19:11:06 +0200 |
commit | 78ee1c72c670a71bfd165448676fc65bff802916 (patch) | |
tree | 893b0f09dfc84f3fd7f1ac218213012f33d5b612 /test | |
parent | 84bbbb91c9154ca0b1c295eb7d1aa0de59450764 (diff) | |
download | ck-78ee1c72c670a71bfd165448676fc65bff802916.tar.gz ck-78ee1c72c670a71bfd165448676fc65bff802916.tar.bz2 ck-78ee1c72c670a71bfd165448676fc65bff802916.zip |
Add ability to use ck without secret dir
Diffstat (limited to 'test')
-rw-r--r-- | test/add.sh (renamed from test/01_add) | 0 | ||||
-rw-r--r-- | test/delete.sh (renamed from test/03_delete) | 0 | ||||
-rw-r--r-- | test/edit.sh (renamed from test/06_edit) | 0 | ||||
-rw-r--r-- | test/init.sh (renamed from test/00_init) | 0 | ||||
-rw-r--r-- | test/init_no_secret.sh | 38 | ||||
-rw-r--r-- | test/list.sh (renamed from test/02_list) | 0 | ||||
-rw-r--r-- | test/restore.sh (renamed from test/05_restore) | 0 | ||||
-rw-r--r-- | test/search.sh (renamed from test/04_search) | 0 |
8 files changed, 38 insertions, 0 deletions
diff --git a/test/01_add b/test/add.sh index 05cf13f..05cf13f 100644 --- a/test/01_add +++ b/test/add.sh diff --git a/test/03_delete b/test/delete.sh index 7e31d66..7e31d66 100644 --- a/test/03_delete +++ b/test/delete.sh diff --git a/test/06_edit b/test/edit.sh index 65419b1..65419b1 100644 --- a/test/06_edit +++ b/test/edit.sh diff --git a/test/00_init b/test/init.sh index a38c81c..a38c81c 100644 --- a/test/00_init +++ b/test/init.sh diff --git a/test/init_no_secret.sh b/test/init_no_secret.sh new file mode 100644 index 0000000..b135377 --- /dev/null +++ b/test/init_no_secret.sh @@ -0,0 +1,38 @@ +running init_no_secret + +mkdir -p $TEST_LOCATION/vc + +exec $BIN/ck -c $BIN init $TEST_LOCATION/vc >&${V} & +wait $! + +if [ $? -ne 0 ]; then + err "ck crashed." +fi + +if [ ! -f $BIN/ckrc ]; then + err "Config file not created." +fi + +if [ "$(sqlite3 $BIN/ckdb "select VAL from CONTEXT where KEY = 'secret_enabled';")" != "0" ]; then + err "secret_enabled should be 0." +fi + +# setup test configs +echo "Test 1" > $BIN/test1.conf + +exec $BIN/ck -c $BIN add prog1 test1.conf -s >&${V} & +wait $! + +if [ $? -eq 0 ]; then + err "Adding secret should fail" +fi + +exec $BIN/ck -c $BIN add prog1 test1.conf >&${V} & +wait $! + +if [ $? -ne 0 ]; then + err "ck crashed." +fi + +clear_tests > /dev/null 2>&1 +echo -e $PASS diff --git a/test/02_list b/test/list.sh index e330dad..e330dad 100644 --- a/test/02_list +++ b/test/list.sh diff --git a/test/05_restore b/test/restore.sh index 2d60cb9..2d60cb9 100644 --- a/test/05_restore +++ b/test/restore.sh diff --git a/test/04_search b/test/search.sh index a315730..a315730 100644 --- a/test/04_search +++ b/test/search.sh |