Skip to content

Commit 9f5ab59

Browse files
authored
Merge pull request #123 from Jakob-Naucke/extend-integration-tests
integration-tests: Verify LUKS key & parallelize
2 parents a416b47 + aa656e8 commit 9f5ab59

File tree

12 files changed

+10570
-172
lines changed

12 files changed

+10570
-172
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: "cargo fmt (check)"
4949
run: cargo fmt -- --check -l
5050
- name: "cargo clippy (warnings)"
51-
run: cargo clippy --all-targets -- -D warnings
51+
run: cargo clippy --all-targets --all-features -- -D warnings
5252
- name: "gofmt (check)"
5353
run: if [ -n "$(gofmt -l .)" ]; then exit 1; fi
5454
- name: "go vet"

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ test-release: crds-rs
172172

173173
integration-tests: generate trusted-cluster-gen crds-rs
174174
RUST_LOG=info cargo test --test trusted_execution_cluster --test attestation \
175-
--features virtualization -- --no-capture --test-threads=1
175+
--features virtualization -- --no-capture --test-threads=3
176176

177177
$(LOCALBIN):
178178
mkdir -p $(LOCALBIN)

REUSE.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ path = [
1212
"docs/pics/*",
1313
"docs/design/*",
1414
"docs/dev/*",
15+
"lib/src/vendor_kopium/*",
1516
"tests/README.md",
1617
"examples/vm-coreos-ign.yaml",
1718
"scripts/install-kubevirt.sh"

lib/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ pub mod conditions;
66
pub mod reference_values;
77

88
mod kopium;
9+
#[allow(clippy::all)]
10+
mod vendor_kopium;
911
pub use kopium::approvedimages::*;
1012
pub use kopium::machines::*;
1113
pub use kopium::trustedexecutionclusters::*;
14+
pub use vendor_kopium::virtualmachineinstances;
15+
pub use vendor_kopium::virtualmachines;
1216

1317
use conditions::*;
1418
use k8s_openapi::apimachinery::pkg::apis::meta::v1::{Condition, Time};

lib/src/vendor_kopium.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// SPDX-FileCopyrightText: Jakob Naucke <[email protected]>
2+
//
3+
// SPDX-License-Identifier: MIT
4+
5+
// CRDs that we vendor because they are only distributed via OLM
6+
7+
pub mod virtualmachineinstances;
8+
pub mod virtualmachines;

lib/src/vendor_kopium/virtualmachineinstances.rs

Lines changed: 5019 additions & 0 deletions
Large diffs are not rendered by default.

lib/src/vendor_kopium/virtualmachines.rs

Lines changed: 5357 additions & 0 deletions
Large diffs are not rendered by default.

test_utils/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ virtualization = []
1313

1414
[dependencies]
1515
anyhow.workspace = true
16+
clevis-pin-trustee-lib.workspace = true
1617
trusted-cluster-operator-lib = { path = "../lib" }
1718
compute-pcrs-lib.workspace = true
1819
env_logger.workspace = true

test_utils/src/lib.rs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ macro_rules! test_info {
4545
}
4646

4747
macro_rules! kube_apply {
48-
($file:expr, $test_name:expr, $log:literal $(, $kustomize:literal)?) => {
48+
($file:expr, $test_name:expr, $log:literal $(, kustomize = $kustomize:literal)? $(, fssa = $fssa:literal)?) => {
4949
test_info!($test_name, $log);
5050
#[allow(unused_mut)]
5151
let mut opt = "-f";
@@ -54,8 +54,15 @@ macro_rules! kube_apply {
5454
opt = "-k";
5555
}
5656
)?
57+
#[allow(unused_mut)]
58+
let mut args = vec!["apply", opt, $file];
59+
$(
60+
if $fssa {
61+
args.extend_from_slice(&["--server-side", "--force-conflicts"])
62+
}
63+
)?
5764
let apply_output = Command::new("kubectl")
58-
.args(["apply", opt, $file])
65+
.args(args)
5966
.output()
6067
.await?;
6168
if !apply_output.status.success() {
@@ -336,7 +343,12 @@ impl TestContext {
336343
"TrustedExecutionCluster CRD already exists, skipping CRD creation"
337344
);
338345
} else {
339-
kube_apply!(crd_temp_dir_str, &self.test_name, "Applying CRDs");
346+
kube_apply!(
347+
crd_temp_dir_str,
348+
&self.test_name,
349+
"Applying CRDs",
350+
fssa = true
351+
);
340352
}
341353

342354
test_info!(&self.test_name, "Preparing RBAC manifests");
@@ -400,7 +412,12 @@ resources:
400412
let temp_kustomization_path = rbac_temp_dir.join("kustomization.yaml");
401413
std::fs::write(&temp_kustomization_path, kustomization_content)?;
402414

403-
kube_apply!(rbac_temp_dir_str, &self.test_name, "Applying RBAC", true);
415+
kube_apply!(
416+
rbac_temp_dir_str,
417+
&self.test_name,
418+
"Applying RBAC",
419+
kustomize = true
420+
);
404421

405422
let manifests_path = Path::new(&self.manifests_dir);
406423
let operator_manifest_path = manifests_path.join("operator.yaml");

0 commit comments

Comments
 (0)