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:
Arzhan Kinzhalin
2019-01-02 14:03:31 -08:00
parent 82f66efec6
commit e4743d8273
11 changed files with 15 additions and 14 deletions
+2 -1
View File
@@ -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" ]
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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" ]
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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 ]
+3 -3
View File
@@ -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
+2 -2
View File
@@ -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 ]
+1 -1
View File
@@ -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 ]
+1 -1
View File
@@ -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 ]
+1 -1
View File
@@ -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 ]
}
+1 -1
View File
@@ -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