Skip to content

Commit

Permalink
tests: add encrypted nydus image tests
Browse files Browse the repository at this point in the history
Add encrypted nydus image tests.

Signed-off-by: ChengyuZhu6 <[email protected]>
  • Loading branch information
ChengyuZhu6 committed Feb 8, 2024
1 parent 2d6906b commit d90c1ef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/image_rs_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs:
cargo clippy -p image-rs --all-targets --features=kata-cc-native-tls --no-default-features -- -D warnings
cargo clippy -p image-rs --all-targets --features=enclave-cc-cckbc-native-tls --no-default-features -- -D warnings
cargo clippy -p image-rs --all-targets --features=kata-cc-native-tls,signature-simple-xrss --no-default-features -- -D warnings
cargo clippy -p image-rs --all-targets --features=kata-cc-native-tls,nydus --no-default-features -- -D warnings
- name: Run cargo build
uses: actions-rs/cargo@v1
Expand All @@ -96,10 +97,6 @@ jobs:
# - name: Run cargo test - kata-cc (native-tls version) with keywrap-grpc + keywrap-jwe
# run: |
# sudo -E PATH=$PATH -s cargo test -p image-rs --no-default-features --features=encryption-openssl,keywrap-grpc,snapshot-overlayfs,signature-cosign-native,signature-simple,getresource,oci-distribution/native-tls,keywrap-jwe

- name: Run cargo test - nydus
run: |
sudo -E PATH=$PATH -s cargo test -p image-rs --features nydus

- name: Run cargo test - kata-cc (rust-tls version) with keywrap-ttrpc (default) + keywrap-jwe
run: |
Expand All @@ -114,3 +111,7 @@ jobs:
AUTH_PASSWORD: ${{ secrets.SH_ICR_API_KEY }}
run: |
sudo -E PATH=$PATH -s cargo test -p image-rs --no-default-features --features=kata-cc-native-tls,keywrap-jwe,signature-simple-xrss
- name: Run cargo test - kata-cc (native-tls version) with keywrap-ttrpc (default) + keywrap-jwe + nydus
run: |
sudo -E PATH=$PATH -s cargo test -p image-rs --no-default-features --features=kata-cc-native-tls,keywrap-jwe,nydus
2 changes: 1 addition & 1 deletion image-rs/src/pull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ mod tests {

for image_url in nydus_images.iter() {
let tempdir = tempfile::tempdir().unwrap();
let image = Reference::try_from((*image_url).clone()).expect("create reference failed");
let image = Reference::try_from(*image_url).expect("create reference failed");
let mut client = PullClient::new(
image,
tempdir.path(),
Expand Down
2 changes: 2 additions & 0 deletions image-rs/tests/image_decryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const OCICRYPT_CONFIG: &str = "test_data/ocicrypt_keyprovider_ttrpc.conf";
#[rstest::rstest]
#[case("ghcr.io/confidential-containers/test-container:unencrypted")]
#[case("ghcr.io/confidential-containers/test-container:encrypted")]
#[cfg_attr(not(feature = "nydus"), ignore)]
#[case("docker.io/zcy1234/busybox:encrypted-nydus")]
#[tokio::test]
#[serial]
async fn test_decrypt_layers(#[case] image: &str) {
Expand Down

0 comments on commit d90c1ef

Please sign in to comment.