Skip to content

Commit

Permalink
test: disable secure boot in some of e2e tests
Browse files Browse the repository at this point in the history
Enabled secureboot in Talemu.
Split e2e-scaling tests: extract forced removal flows from it.
Changed the tests flags to support more complicated machine provision
flows: now it can read the config from the yaml file.

Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
  • Loading branch information
Unix4ever committed Oct 30, 2024
1 parent 58159e4 commit 7e4a7a2
Show file tree
Hide file tree
Showing 13 changed files with 339 additions and 75 deletions.
85 changes: 83 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-10-21T13:53:43Z by kres 34e72ac.
# Generated on 2024-10-30T12:35:59Z by kres 6d3cad4.

name: default
concurrency:
Expand Down Expand Up @@ -294,6 +294,7 @@ jobs:
xargs -a _out/executable-artifacts -I {} chmod +x {}
- name: run-integration-test
env:
ENABLE_SECUREBOOT: "false"
INTEGRATION_RUN_E2E_TEST: "false"
INTEGRATION_TEST_ARGS: --test.run CleanState/|EtcdBackupAndRestore
RUN_TALEMU_TESTS: "false"
Expand All @@ -311,6 +312,85 @@ jobs:
!~/.talos/clusters/**/swtpm.log
retention-days: "5"
continue-on-error: true
e2e-forced-removal:
runs-on:
- self-hosted
- omni
if: contains(fromJSON(needs.default.outputs.labels), 'integration/e2e') || contains(fromJSON(needs.default.outputs.labels), 'integration/e2e-forced-removal')
needs:
- default
steps:
- name: gather-system-info
id: system-info
uses: kenchan0130/actions-system-info@v1.3.0
continue-on-error: true
- name: print-system-info
run: |
MEMORY_GB=$((${{ steps.system-info.outputs.totalmem }}/1024/1024/1024))
OUTPUTS=(
"CPU Core: ${{ steps.system-info.outputs.cpu-core }}"
"CPU Model: ${{ steps.system-info.outputs.cpu-model }}"
"Hostname: ${{ steps.system-info.outputs.hostname }}"
"NodeName: ${NODE_NAME}"
"Kernel release: ${{ steps.system-info.outputs.kernel-release }}"
"Kernel version: ${{ steps.system-info.outputs.kernel-version }}"
"Name: ${{ steps.system-info.outputs.name }}"
"Platform: ${{ steps.system-info.outputs.platform }}"
"Release: ${{ steps.system-info.outputs.release }}"
"Total memory: ${MEMORY_GB} GB"
)
for OUTPUT in "${OUTPUTS[@]}";do
echo "${OUTPUT}"
done
continue-on-error: true
- name: checkout
uses: actions/checkout@v4
- name: Unshallow
run: |
git fetch --prune --unshallow
- name: Set up Docker Buildx
id: setup-buildx
uses: docker/setup-buildx-action@v3
with:
driver: remote
endpoint: tcp://buildkit-amd64.ci.svc.cluster.local:1234
timeout-minutes: 10
- name: Mask secrets
run: |
echo "$(sops -d .secrets.yaml | yq -e '.secrets | to_entries[] | "::add-mask::" + .value')"
- name: Set secrets for job
run: |
sops -d .secrets.yaml | yq -e '.secrets | to_entries[] | .key + "=" + .value' >> "$GITHUB_ENV"
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: artifacts
path: _out
- name: Fix artifact permissions
run: |
xargs -a _out/executable-artifacts -I {} chmod +x {}
- name: run-integration-test
env:
ENABLE_SECUREBOOT: "false"
INTEGRATION_RUN_E2E_TEST: "false"
INTEGRATION_TEST_ARGS: --test.run CleanState/|ForcedMachineRemoval/|ReplaceControlPlanes/|ConfigPatching/|KubernetesNodeAudit/
RUN_TALEMU_TESTS: "false"
TALEMU_TEST_ARGS: --test.run ImmediateClusterDestruction/|EncryptedCluster/|SinglenodeCluster/|ScaleUpAndDown/|ScaleUpAndDownMachineClassBasedMachineSets/|TalosUpgrades/|KubernetesUpgrades/|MaintenanceDowngrade/|ClusterTemplate/|ScaleUpAndDownAutoProvisionMachineSets/
WITH_DEBUG: "true"
run: |
sudo -E make run-integration-test
- name: save-talos-logs-artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: talos-logs-e2e-forced-removal
path: |-
~/.talos/clusters/**/*.log
!~/.talos/clusters/**/swtpm.log
retention-days: "5"
continue-on-error: true
e2e-scaling:
runs-on:
- self-hosted
Expand Down Expand Up @@ -373,7 +453,7 @@ jobs:
- name: run-integration-test
env:
INTEGRATION_RUN_E2E_TEST: "false"
INTEGRATION_TEST_ARGS: --test.run CleanState/|ScaleUpAndDown/|ScaleUpAndDownMachineClassBasedMachineSets/|RollingUpdateParallelism/|ForcedMachineRemoval/|ReplaceControlPlanes/|ConfigPatching/|KubernetesNodeAudit/
INTEGRATION_TEST_ARGS: --test.run CleanState/|ScaleUpAndDown/|ScaleUpAndDownMachineClassBasedMachineSets/|RollingUpdateParallelism
RUN_TALEMU_TESTS: "false"
TALEMU_TEST_ARGS: --test.run ImmediateClusterDestruction/|EncryptedCluster/|SinglenodeCluster/|ScaleUpAndDown/|ScaleUpAndDownMachineClassBasedMachineSets/|TalosUpgrades/|KubernetesUpgrades/|MaintenanceDowngrade/|ClusterTemplate/|ScaleUpAndDownAutoProvisionMachineSets/
WITH_DEBUG: "true"
Expand Down Expand Up @@ -528,6 +608,7 @@ jobs:
xargs -a _out/executable-artifacts -I {} chmod +x {}
- name: run-integration-test
env:
ENABLE_SECUREBOOT: "false"
INTEGRATION_RUN_E2E_TEST: "false"
INTEGRATION_TEST_ARGS: --test.run CleanState/|ClusterTemplate/
RUN_TALEMU_TESTS: "false"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/e2e-backups-cron.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-09-30T14:56:12Z by kres 8be5fa7.
# Generated on 2024-10-30T12:35:59Z by kres 6d3cad4.

name: e2e-backups-cron
concurrency:
Expand Down Expand Up @@ -60,6 +60,7 @@ jobs:
sops -d .secrets.yaml | yq -e '.secrets | to_entries[] | .key + "=" + .value' >> "$GITHUB_ENV"
- name: run-integration-test
env:
ENABLE_SECUREBOOT: "false"
INTEGRATION_RUN_E2E_TEST: "false"
INTEGRATION_TEST_ARGS: --test.run CleanState/|EtcdBackupAndRestore
RUN_TALEMU_TESTS: "false"
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/e2e-forced-removal-cron.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-10-30T12:35:59Z by kres 6d3cad4.

name: e2e-forced-removal-cron
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
"on":
schedule:
- cron: 30 1 * * *
jobs:
default:
runs-on:
- self-hosted
- omni
steps:
- name: gather-system-info
id: system-info
uses: kenchan0130/actions-system-info@v1.3.0
continue-on-error: true
- name: print-system-info
run: |
MEMORY_GB=$((${{ steps.system-info.outputs.totalmem }}/1024/1024/1024))
OUTPUTS=(
"CPU Core: ${{ steps.system-info.outputs.cpu-core }}"
"CPU Model: ${{ steps.system-info.outputs.cpu-model }}"
"Hostname: ${{ steps.system-info.outputs.hostname }}"
"NodeName: ${NODE_NAME}"
"Kernel release: ${{ steps.system-info.outputs.kernel-release }}"
"Kernel version: ${{ steps.system-info.outputs.kernel-version }}"
"Name: ${{ steps.system-info.outputs.name }}"
"Platform: ${{ steps.system-info.outputs.platform }}"
"Release: ${{ steps.system-info.outputs.release }}"
"Total memory: ${MEMORY_GB} GB"
)
for OUTPUT in "${OUTPUTS[@]}";do
echo "${OUTPUT}"
done
continue-on-error: true
- name: checkout
uses: actions/checkout@v4
- name: Unshallow
run: |
git fetch --prune --unshallow
- name: Set up Docker Buildx
id: setup-buildx
uses: docker/setup-buildx-action@v3
with:
driver: remote
endpoint: tcp://buildkit-amd64.ci.svc.cluster.local:1234
timeout-minutes: 10
- name: Mask secrets
run: |
echo "$(sops -d .secrets.yaml | yq -e '.secrets | to_entries[] | "::add-mask::" + .value')"
- name: Set secrets for job
run: |
sops -d .secrets.yaml | yq -e '.secrets | to_entries[] | .key + "=" + .value' >> "$GITHUB_ENV"
- name: run-integration-test
env:
ENABLE_SECUREBOOT: "false"
INTEGRATION_RUN_E2E_TEST: "false"
INTEGRATION_TEST_ARGS: --test.run CleanState/|ForcedMachineRemoval/|ReplaceControlPlanes/|ConfigPatching/|KubernetesNodeAudit/
RUN_TALEMU_TESTS: "false"
TALEMU_TEST_ARGS: --test.run ImmediateClusterDestruction/|EncryptedCluster/|SinglenodeCluster/|ScaleUpAndDown/|ScaleUpAndDownMachineClassBasedMachineSets/|TalosUpgrades/|KubernetesUpgrades/|MaintenanceDowngrade/|ClusterTemplate/|ScaleUpAndDownAutoProvisionMachineSets/
WITH_DEBUG: "true"
run: |
sudo -E make run-integration-test
- name: save-talos-logs-artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: talos-logs
path: |-
~/.talos/clusters/**/*.log
!~/.talos/clusters/**/swtpm.log
retention-days: "5"
4 changes: 2 additions & 2 deletions .github/workflows/e2e-scaling-cron.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-09-30T14:56:12Z by kres 8be5fa7.
# Generated on 2024-10-30T12:35:59Z by kres 6d3cad4.

name: e2e-scaling-cron
concurrency:
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
- name: run-integration-test
env:
INTEGRATION_RUN_E2E_TEST: "false"
INTEGRATION_TEST_ARGS: --test.run CleanState/|ScaleUpAndDown/|ScaleUpAndDownMachineClassBasedMachineSets/|RollingUpdateParallelism/|ForcedMachineRemoval/|ReplaceControlPlanes/|ConfigPatching/|KubernetesNodeAudit/
INTEGRATION_TEST_ARGS: --test.run CleanState/|ScaleUpAndDown/|ScaleUpAndDownMachineClassBasedMachineSets/|RollingUpdateParallelism
RUN_TALEMU_TESTS: "false"
TALEMU_TEST_ARGS: --test.run ImmediateClusterDestruction/|EncryptedCluster/|SinglenodeCluster/|ScaleUpAndDown/|ScaleUpAndDownMachineClassBasedMachineSets/|TalosUpgrades/|KubernetesUpgrades/|MaintenanceDowngrade/|ClusterTemplate/|ScaleUpAndDownAutoProvisionMachineSets/
WITH_DEBUG: "true"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/e2e-templates-cron.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-09-30T14:56:12Z by kres 8be5fa7.
# Generated on 2024-10-30T12:35:59Z by kres 6d3cad4.

name: e2e-templates-cron
concurrency:
Expand Down Expand Up @@ -60,6 +60,7 @@ jobs:
sops -d .secrets.yaml | yq -e '.secrets | to_entries[] | .key + "=" + .value' >> "$GITHUB_ENV"
- name: run-integration-test
env:
ENABLE_SECUREBOOT: "false"
INTEGRATION_RUN_E2E_TEST: "false"
INTEGRATION_TEST_ARGS: --test.run CleanState/|ClusterTemplate/
RUN_TALEMU_TESTS: "false"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/slack-notify.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-08-15T23:44:03Z by kres 7be2a05.
# Generated on 2024-10-30T12:35:59Z by kres 6d3cad4.

name: slack-notify
"on":
Expand All @@ -9,6 +9,7 @@ name: slack-notify
- default
- e2e-short-cron
- e2e-scaling-cron
- e2e-forced-removal-cron
- e2e-upgrades-cron
- e2e-templates-cron
- e2e-backups-cron
Expand Down
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-06-19T21:17:41Z by kres 4c9f215.
# Generated on 2024-10-30T12:55:25Z by kres 6d3cad4.

# options for analysis running
run:
timeout: 10m
issues-exit-code: 1
tests: true
modules-download-mode: readonly
build-tags: [ ]
modules-download-mode: readonly

# output configuration options
output:
Expand Down
18 changes: 17 additions & 1 deletion .kres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,21 @@ spec:
- integration/e2e-scaling
environmentOverride:
INTEGRATION_RUN_E2E_TEST: "false"
INTEGRATION_TEST_ARGS: "--test.run CleanState/|ScaleUpAndDown/|ScaleUpAndDownMachineClassBasedMachineSets/|RollingUpdateParallelism/|ForcedMachineRemoval/|ReplaceControlPlanes/|ConfigPatching/|KubernetesNodeAudit/"
INTEGRATION_TEST_ARGS: "--test.run CleanState/|ScaleUpAndDown/|ScaleUpAndDownMachineClassBasedMachineSets/|RollingUpdateParallelism"
RUN_TALEMU_TESTS: false
- name: e2e-forced-removal
crons:
- '30 1 * * *'
runnerLabels:
- omni
triggerLabels:
- integration/e2e
- integration/e2e-forced-removal
environmentOverride:
INTEGRATION_RUN_E2E_TEST: "false"
INTEGRATION_TEST_ARGS: "--test.run CleanState/|ForcedMachineRemoval/|ReplaceControlPlanes/|ConfigPatching/|KubernetesNodeAudit/"
RUN_TALEMU_TESTS: false
ENABLE_SECUREBOOT: false
- name: e2e-upgrades
crons:
- '30 1 * * *'
Expand All @@ -226,6 +239,7 @@ spec:
INTEGRATION_RUN_E2E_TEST: "false"
INTEGRATION_TEST_ARGS: "--test.run CleanState/|ClusterTemplate/"
RUN_TALEMU_TESTS: false
ENABLE_SECUREBOOT: false
- name: e2e-backups
crons:
- '30 1 * * *'
Expand All @@ -238,6 +252,7 @@ spec:
INTEGRATION_RUN_E2E_TEST: "false"
INTEGRATION_TEST_ARGS: "--test.run CleanState/|EtcdBackupAndRestore"
RUN_TALEMU_TESTS: false
ENABLE_SECUREBOOT: false
- name: e2e-workload-proxy
crons:
- '30 1 * * *'
Expand Down Expand Up @@ -581,3 +596,4 @@ spec:
- e2e-templates
- e2e-upgrades
- e2e-backups
- e2e-forced-removal
Loading

0 comments on commit 7e4a7a2

Please sign in to comment.