Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/suites: Grep for trusted certificate names with -wF flags (stable-4.0) #13737

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions test/suites/pki.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ test_pki() {
lxc_remote remote add pki-lxd "${LXD5_ADDR}" --accept-certificate --password foo

# Should have trust store entry because `core.trust_ca_certificates` is disabled.
lxc_remote config trust ls pki-lxd: | grep lxd-client
lxc_remote config trust ls pki-lxd: | grep -wF lxd-client

# Should be able to view server config
lxc_remote info pki-lxd: | grep -F 'core.https_address'
Expand Down Expand Up @@ -123,7 +123,7 @@ test_pki() {
lxc_remote remote add pki-lxd "${LXD5_ADDR}" --accept-certificate

# Client cert should not be present in trust store.
! lxc_remote config trust ls pki-lxd: | grep ca-trusted || false
! lxc_remote config trust ls pki-lxd: | grep -wF ca-trusted || false

# Remove remote
lxc_remote remote remove pki-lxd
Expand All @@ -133,7 +133,7 @@ test_pki() {
lxc_remote remote add pki-lxd "${LXD5_ADDR}" --accept-certificate --password=bar

# Client cert should not be present in trust store.
! lxc_remote config trust ls pki-lxd: | grep ca-trusted || false
! lxc_remote config trust ls pki-lxd: | grep -wF ca-trusted || false

# The certificate is trusted as root because `core.trust_ca_certificates` is enabled.
lxc_remote info pki-lxd: | grep -F 'core.https_address'
Expand Down Expand Up @@ -176,7 +176,7 @@ test_pki() {
# Try adding a remote using a revoked client certificate, and the correct password.
# This should fail, and the revoked certificate should not be added to the trust store.
! lxc_remote remote add pki-lxd "${LXD5_ADDR}" --accept-certificate --password foo || false
! lxc config trust ls | grep prior-revoked || false
! lxc config trust ls | grep -wF prior-revoked || false

# Try adding a remote using a revoked client certificate, and an incorrect password.
# This should fail, as if the certificate is revoked and password is wrong then no access should be allowed.
Expand All @@ -188,7 +188,7 @@ test_pki() {
# Try adding a remote using a revoked client certificate, and the correct password.
# This should fail, and the revoked certificate should not be added to the trust store.
! lxc_remote remote add pki-lxd "${LXD5_ADDR}" --accept-certificate --password foo || false
! lxc config trust ls | grep prior-revoked || false
! lxc config trust ls | grep -wF prior-revoked || false

# Try adding a remote using a revoked client certificate, and an incorrect password.
# This should fail, as if the certificate is revoked and password is wrong then no access should be allowed.
Expand Down
Loading