2020-11-18 23:23:15 +00:00
|
|
|
load test_helper
|
|
|
|
|
|
|
|
@test "Outputs help if run without arguments" {
|
2020-11-19 03:22:08 +00:00
|
|
|
run sig
|
2020-11-18 23:23:15 +00:00
|
|
|
[ "$status" -eq 0 ]
|
2020-11-19 00:52:09 +00:00
|
|
|
echo "${output}" | grep "simple multisig trust toolchain"
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "Outputs help if run with help" {
|
2020-11-19 03:22:08 +00:00
|
|
|
run sig help
|
2020-11-19 00:52:09 +00:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
echo "${output}" | grep "simple multisig trust toolchain"
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "Outputs version if run with version" {
|
2020-11-19 03:22:08 +00:00
|
|
|
run sig version
|
2020-11-19 00:52:09 +00:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
echo "${output}" | grep "v0.0.1"
|
2020-11-18 23:23:15 +00:00
|
|
|
}
|
2020-11-19 03:22:08 +00:00
|
|
|
|
|
|
|
@test "Outputs advice to install missing openssl" {
|
2020-11-19 21:40:38 +00:00
|
|
|
sudo rm /usr/bin/openssl
|
2020-11-19 03:22:08 +00:00
|
|
|
run sig version
|
|
|
|
echo "${output}" | grep "apt install openssl"
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "Outputs advice to install missing gpg" {
|
2020-11-19 21:40:38 +00:00
|
|
|
sudo rm /usr/bin/gpg
|
2020-11-19 03:22:08 +00:00
|
|
|
run sig version
|
|
|
|
echo "${output}" | grep "apt install gnupg"
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "Outputs advice to install missing getopt" {
|
2020-11-19 21:40:38 +00:00
|
|
|
sudo rm /usr/bin/getopt
|
2020-11-19 03:22:08 +00:00
|
|
|
run sig version
|
|
|
|
echo "${output}" | grep "apt install getopt"
|
|
|
|
}
|
|
|
|
|
2020-11-19 21:40:38 +00:00
|
|
|
@test "Can generate manifest for git repo" {
|
|
|
|
set_identity "user1"
|
2020-11-19 03:22:08 +00:00
|
|
|
echo "test string" > somefile
|
2020-11-19 21:40:38 +00:00
|
|
|
git init
|
|
|
|
git add .
|
|
|
|
git commit -m "initial commit"
|
2020-11-19 03:22:08 +00:00
|
|
|
sig manifest
|
2020-11-19 21:40:38 +00:00
|
|
|
run grep -q "1" <(wc -l .sig/manifest.txt)
|
|
|
|
[ "$status" -eq 0 ]
|
2020-11-19 03:22:08 +00:00
|
|
|
run grep 37d2046a395cbfc .sig/manifest.txt
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "Can generate manifest for folder with git not installed" {
|
2020-11-19 21:40:38 +00:00
|
|
|
sudo rm /usr/bin/git
|
2020-11-19 03:22:08 +00:00
|
|
|
echo "test string" > somefile
|
|
|
|
sig manifest
|
|
|
|
run grep 37d2046a395cbfc .sig/manifest.txt
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
}
|
|
|
|
|
2020-11-19 21:40:38 +00:00
|
|
|
@test "Can generate manifest for folder with git installed" {
|
2020-11-19 03:22:08 +00:00
|
|
|
echo "test string" > somefile
|
|
|
|
sig manifest
|
|
|
|
run grep 37d2046a395cbfc .sig/manifest.txt
|
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
}
|