Skip to content

Commit

Permalink
ci/cli: add backup/restore test with RKE2
Browse files Browse the repository at this point in the history
Signed-off-by: Loic Devulder <ldevulder@suse.com>
  • Loading branch information
ldevulder committed Sep 10, 2024
1 parent b952381 commit c2f9eef
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/sub_cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,8 @@ jobs:
kubectl apply -f tests/assets/add_missing_dynamicschemas.yaml
fi
- name: Install backup-restore components (K3s only for now)
- name: Install backup-restore components
id: install_backup_restore
if: ${{ contains(inputs.k8s_upstream_version, 'k3s') }}
env:
BACKUP_RESTORE_VERSION: ${{ inputs.backup_restore_version }}
run: cd tests && make e2e-install-backup-restore
Expand Down Expand Up @@ -337,7 +336,6 @@ jobs:
- name: Test Backup/Restore Elemental resources with Rancher Manager
id: test_backup_restore
if: ${{ contains(inputs.k8s_upstream_version, 'k3s') }}
run: |
cd tests && make e2e-backup-restore && make e2e-check-app
Expand Down
21 changes: 17 additions & 4 deletions tests/e2e/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ var _ = Describe("E2E - Install Rancher Manager", Label("install"), func() {
// Delay few seconds before checking
time.Sleep(tools.SetTimeout(20 * time.Second))

// Set kubectl command and KUBECONFIG variable
err = exec.Command("sudo", "ln", "-s", "/var/lib/rancher/rke2/bin/kubectl", "/usr/local/bin/kubectl").Run()
Expect(err).To(Not(HaveOccurred()))
err = os.Setenv("KUBECONFIG", "/etc/rancher/rke2/rke2.yaml")
Expect(err).To(Not(HaveOccurred()))
})

By("Waiting for RKE2 to be started", func() {
// Wait for all pods to be started
err := os.Setenv("KUBECONFIG", "/etc/rancher/rke2/rke2.yaml")
Expect(err).To(Not(HaveOccurred()))

checkList := [][]string{
{"kube-system", "k8s-app=kube-dns"},
{"kube-system", "app.kubernetes.io/name=rke2-ingress-nginx"},
Expand All @@ -117,9 +117,22 @@ var _ = Describe("E2E - Install Rancher Manager", Label("install"), func() {
return rancher.CheckPod(k, checkList)
}, tools.SetTimeout(4*time.Minute), 30*time.Second).Should(BeNil())

err = k.WaitLabelFilter("kube-system", "Ready", "rke2-ingress-nginx-controller", "app.kubernetes.io/name=rke2-ingress-nginx")
err := k.WaitLabelFilter("kube-system", "Ready", "rke2-ingress-nginx-controller", "app.kubernetes.io/name=rke2-ingress-nginx")
Expect(err).To(Not(HaveOccurred()))
})

By("Installing local-path-provisionner", func() {
localPathNS := "kube-system"
kubectl.Apply(localPathNS, localStorageYaml)

// Wait for all pods to be started
checkList := [][]string{
{localPathNS, "app=local-path-provisioner"},
}
Eventually(func() error {
return rancher.CheckPod(k, checkList)
}, tools.SetTimeout(2*time.Minute), 30*time.Second).Should(BeNil())
})
} else {
// Report to Qase
testCaseID = 59
Expand Down

0 comments on commit c2f9eef

Please sign in to comment.