Skip to content

Commit

Permalink
ci: Add CI test for orphan retention policy
Browse files Browse the repository at this point in the history
- Add `test_orphan_retention_policy` test and update
  GitHub Actions workflow to test orphan retention policy

Signed-off-by: Parthiba-Hazra <[email protected]>
  • Loading branch information
Parthiba-Hazra committed Aug 12, 2024
1 parent 16c4b55 commit e00d9e5
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,6 @@ jobs:

- name: Test Max Checkpoint Size
run: sudo -E bats -f "test_max_checkpoint_size" ./test/run_tests.bats

- name: Test orphan retention
run: sudo -E bats -f "test_orphan_retention_policy" ./test/run_tests.bats
11 changes: 11 additions & 0 deletions test/run_tests.bats
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,14 @@ function teardown() {
log_and_run ls -la "$CHECKPOINT_DIR"
[ "$status" -eq 0 ]
}

@test "test_orphan_retention_policy" {
log_and_run kubectl apply -f ./test/test_orphan_checkpointrestoreoperator.yaml
[ "$status" -eq 0 ]
log_and_run ./test/generate_checkpoint_tar.sh
[ "$status" -eq 0 ]
log_and_run ./test/wait_for_checkpoint_reduction.sh 0
[ "$status" -eq 0 ]
log_and_run ls -la "$CHECKPOINT_DIR"
[ "$status" -eq 0 ]
}
20 changes: 20 additions & 0 deletions test/test_orphan_checkpointrestoreoperator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: criu.org/v1
kind: CheckpointRestoreOperator
metadata:
labels:
app.kubernetes.io/name: checkpointrestoreoperator
app.kubernetes.io/instance: checkpointrestoreoperator-sample
app.kubernetes.io/part-of: checkpoint-restore-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: checkpoint-restore-operator
name: checkpointrestoreoperator-sample
spec:
checkpointDirectory: /var/lib/kubelet/checkpoints
applyPoliciesImmediately: true
globalPolicy:
retainOrphan: true
containerPolicies:
- namespace: namespace
pod: podname
container: containername
retainOrphan: false

0 comments on commit e00d9e5

Please sign in to comment.