From 0892ebdc59c5eb080d616b2abea57913d70f84f9 Mon Sep 17 00:00:00 2001 From: Tad Fisher Date: Thu, 16 Mar 2017 14:43:05 -0700 Subject: Add test harness and basic insert test --- test/insert.t | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 test/insert.t (limited to 'test/insert.t') diff --git a/test/insert.t b/test/insert.t new file mode 100755 index 0000000..a78971f --- /dev/null +++ b/test/insert.t @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +export test_description="Tests pass otp insert commands" + +. ./setup.sh + +test_expect_success 'Inserts a basic TOTP key' ' + "$PASS" init $KEY1 && + "$PASS" otp insert totp -s AAAAAAAAAAAAAAAAAAAAA totp-secret +' + +test_expect_success 'Commits insert to git' ' + git init "$PASSWORD_STORE_DIR" && + "$PASS" init $KEY1 && + "$PASS" otp insert totp -s AAAAAAAAAAAAAAAAAAAAA totp-secret2 && + git log --no-decorate -1 | grep "Add given OTP secret for totp-secret2 to store." +' + +test_done -- cgit v1.2.3