mirror of
https://github.com/clearlinux/clrtrust.git
synced 2026-11-18 19:23:13 +00:00
Fix tests.
Corrected expected file counts in the store where ls or find are used. It's count + 1 now due to extra symlink clrtrust generates.
This commit is contained in:
@@ -11,7 +11,8 @@ setup() {
|
||||
@test "generate empty store, fail to add certificates" {
|
||||
$CLRTRUST generate
|
||||
cnt=$(ls $STORE/anchors | wc -l)
|
||||
[ $cnt -eq 0 ]
|
||||
ls $STORE/anchors
|
||||
[ $cnt -eq 1 ]
|
||||
run $CLRTRUST list
|
||||
[ $status -eq 0 ]
|
||||
[ -z "$output" ]
|
||||
|
||||
@@ -12,7 +12,7 @@ setup() {
|
||||
@test "add, remove files with spaces in names" {
|
||||
$CLRTRUST generate
|
||||
cnt=$(ls $STORE/anchors | wc -l)
|
||||
[ $cnt -eq 2 ] # file and symlink
|
||||
[ $cnt -eq 3 ] # file and symlink
|
||||
run $CLRTRUST list
|
||||
[ $status -eq 0 ]
|
||||
cnt=$(echo "$output"| grep ^id | wc -l)
|
||||
|
||||
@@ -11,7 +11,7 @@ setup() {
|
||||
@test "generate empty store, add certificate" {
|
||||
$CLRTRUST generate
|
||||
cnt=$(ls $STORE/anchors | wc -l)
|
||||
[ $cnt -eq 0 ]
|
||||
[ $cnt -eq 1 ]
|
||||
run $CLRTRUST list
|
||||
[ $status -eq 0 ]
|
||||
[ -z "$output" ]
|
||||
|
||||
@@ -13,7 +13,7 @@ setup() {
|
||||
@test "distrust Clear-provided cert, add it back" {
|
||||
$CLRTRUST generate
|
||||
cnt=$(ls $STORE/anchors | wc -l)
|
||||
[ $cnt -eq 8 ]
|
||||
[ $cnt -eq 9 ]
|
||||
cnt=$($CLRTRUST list | grep ^id | wc -l)
|
||||
[ $cnt -eq 4 ]
|
||||
$CLRTRUST remove $CERTS/c1.pem
|
||||
|
||||
@@ -12,7 +12,7 @@ setup() {
|
||||
@test "generate store, all provided by Clear Linux" {
|
||||
$CLRTRUST generate
|
||||
cnt=$(ls $STORE/anchors | wc -l)
|
||||
[ $cnt -eq 8 ]
|
||||
[ $cnt -eq 9 ]
|
||||
cnt=$($CLRTRUST list | grep ^id | wc -l)
|
||||
[ $cnt -eq 4 ]
|
||||
[ -f $STORE/compat/ca-roots.keystore ]
|
||||
|
||||
@@ -18,7 +18,7 @@ setup() {
|
||||
run $CLRTRUST generate
|
||||
[ $status -eq 0 ]
|
||||
cnt=$(ls $STORE/anchors | wc -l)
|
||||
[ $cnt -eq 8 ]
|
||||
[ $cnt -eq 9 ]
|
||||
cnt=$($CLRTRUST list | grep ^id | wc -l)
|
||||
[ $cnt -eq 4 ]
|
||||
}
|
||||
@@ -28,7 +28,7 @@ setup() {
|
||||
run $CLRTRUST generate
|
||||
[ $status -eq 0 ]
|
||||
cnt=$(ls $STORE/anchors | wc -l)
|
||||
[ $cnt -eq 8 ]
|
||||
[ $cnt -eq 9 ]
|
||||
cnt=$($CLRTRUST list | grep ^id | wc -l)
|
||||
[ $cnt -eq 4 ]
|
||||
$CLRTRUST list
|
||||
@@ -39,7 +39,7 @@ setup() {
|
||||
run $CLRTRUST generate
|
||||
[ $status -eq 0 ]
|
||||
cnt=$(ls $STORE/anchors | wc -l)
|
||||
[ $cnt -eq 8 ]
|
||||
[ $cnt -eq 9 ]
|
||||
cnt=$($CLRTRUST list | grep ^id | wc -l)
|
||||
[ $cnt -eq 4 ]
|
||||
$CLRTRUST list
|
||||
|
||||
@@ -13,9 +13,9 @@ setup() {
|
||||
@test "generate store, using internal rehash" {
|
||||
$CLRTRUST -c generate
|
||||
cnt=$(ls $STORE/anchors | wc -l)
|
||||
[ $cnt -eq 8 ]
|
||||
[ $cnt -eq 9 ]
|
||||
cnt=$(find $STORE/anchors -type l | wc -l)
|
||||
[ $cnt -eq 4 ]
|
||||
[ $cnt -eq 5 ]
|
||||
cnt=$($CLRTRUST list | grep ^id | wc -l)
|
||||
[ $cnt -eq 4 ]
|
||||
[ -f $STORE/compat/ca-roots.keystore ]
|
||||
|
||||
@@ -12,7 +12,7 @@ setup() {
|
||||
@test "generate store, all local" {
|
||||
$CLRTRUST generate
|
||||
cnt=$(ls $STORE/anchors | wc -l)
|
||||
[ $cnt -eq 8 ]
|
||||
[ $cnt -eq 9 ]
|
||||
cnt=$($CLRTRUST list | grep ^id | wc -l)
|
||||
[ $cnt -eq 4 ]
|
||||
[ -f $STORE/compat/ca-roots.keystore ]
|
||||
|
||||
@@ -13,7 +13,7 @@ setup() {
|
||||
@test "generate store, source both Clear and local" {
|
||||
$CLRTRUST generate
|
||||
cnt=$(ls $STORE/anchors | wc -l)
|
||||
[ $cnt -eq 8 ]
|
||||
[ $cnt -eq 9 ]
|
||||
cnt=$($CLRTRUST list | grep ^id | wc -l)
|
||||
[ $cnt -eq 4 ]
|
||||
[ -f $STORE/compat/ca-roots.keystore ]
|
||||
|
||||
@@ -15,7 +15,7 @@ setup() {
|
||||
$CLRTRUST generate
|
||||
cnt=$(ls $STORE/anchors | wc -l)
|
||||
[ ! -f $STORE/anchors/c2.pem ]
|
||||
[ $cnt -eq 6 ]
|
||||
[ $cnt -eq 7 ]
|
||||
cnt=$($CLRTRUST list | grep ^id | wc -l)
|
||||
[ $cnt -eq 3 ]
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ setup() {
|
||||
run $CLRTRUST generate
|
||||
[ $status -eq 0 ]
|
||||
cnt=$(ls $STORE/anchors | wc -l)
|
||||
[ $cnt -eq 8 ]
|
||||
[ $cnt -eq 9 ]
|
||||
cnt=$($CLRTRUST list | grep ^id | wc -l)
|
||||
[ $cnt -eq 4 ]
|
||||
# removing a Clear-provided CA should "distrust" it, not remove
|
||||
|
||||
Reference in New Issue
Block a user