-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When the local trust sources are not present, add and remove fail to add certificates.
- Loading branch information
Showing
3 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bats | ||
# Copyright 2017 Intel Corporation | ||
|
||
load test_lib | ||
|
||
setup() { | ||
find_clrtrust | ||
setup_fs | ||
rm -rf $CLR_LOCAL_TRUST_SRC/trusted $CLR_LOCAL_TRUST_SRC/distrusted | ||
} | ||
|
||
@test "add cert when the local trust src is not there" { | ||
# add acceptable CA | ||
run $CLRTRUST add $CERTS/c1.pem | ||
[ $status -eq 0 ] | ||
run $CLRTRUST list | ||
[ $status -eq 0 ] | ||
cnt=$(echo "$output" | grep ^id | wc -l) | ||
[ $cnt -eq 1 ] | ||
[ -d $CLR_LOCAL_TRUST_SRC/trusted ] | ||
[ -d $CLR_LOCAL_TRUST_SRC/distrusted ] | ||
} | ||
|
||
teardown() { | ||
remove_fs | ||
} | ||
|
||
# vim: ft=sh:sw=4:ts=4:et:tw=80:si:noai:nocin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bats | ||
# Copyright 2017 Intel Corporation | ||
|
||
load test_lib | ||
|
||
setup() { | ||
find_clrtrust | ||
setup_fs | ||
cp $CERTS/c1.pem $CLR_CLEAR_TRUST_SRC/trusted | ||
rm -rf $CLR_LOCAL_TRUST_SRC | ||
} | ||
|
||
@test "remove cert when local trust src is not there" { | ||
# add acceptable CA | ||
run $CLRTRUST remove $CERTS/c1.pem | ||
[ $status -eq 0 ] | ||
run $CLRTRUST list | ||
[ $status -eq 0 ] | ||
cnt=$(echo "$output" | grep ^id | wc -l) | ||
[ $cnt -eq 0 ] | ||
[ -d $CLR_LOCAL_TRUST_SRC/trusted ] | ||
[ -d $CLR_LOCAL_TRUST_SRC/distrusted ] | ||
} | ||
|
||
teardown() { | ||
remove_fs | ||
} | ||
|
||
# vim: ft=sh:sw=4:ts=4:et:tw=80:si:noai:nocin |