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

Protect the Swupd_Root.pem certificate file #1632

Merged
merged 1 commit into from
Aug 27, 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
13 changes: 10 additions & 3 deletions test/functional/only_in_ci_system/api-3rd-party-add.bats
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

load "../testlib"

SWUPD_ROOT_CERT=/usr/share/clear/update-ca/Swupd_Root.pem

test_setup() {

# Skip this test for local development because we write the certificate on /
Expand All @@ -16,9 +18,11 @@ test_setup() {

create_test_environment "$TEST_NAME"

sudo rm -f /usr/share/clear/update-ca/Swupd_Root.pem
# Backup the original certificate
[[ -f ${SWUPD_ROOT_CERT} ]] &&
mv ${SWUPD_ROOT_CERT} ${SWUPD_ROOT_CERT}.orig
sudo mkdir -p /usr/share/clear/update-ca
sudo cp test/functional/only_in_ci_system/pemfile /usr/share/clear/update-ca/Swupd_Root.pem
sudo cp test/functional/only_in_ci_system/pemfile ${SWUPD_ROOT_CERT}

create_third_party_repo "$TEST_NAME" 10 staging repo1
export repo1="$ABS_TP_URL"
Expand All @@ -31,7 +35,10 @@ test_teardown() {
return
fi

sudo rm -f /usr/share/clear/update-ca/Swupd_Root.pem
sudo rm -f ${SWUPD_ROOT_CERT}
# Restore the original certificate
[[ -f ${SWUPD_ROOT_CERT}.orig ]] &&
mv ${SWUPD_ROOT_CERT}.orig ${SWUPD_ROOT_CERT}

}

Expand Down
Loading