Skip to content

Commit

Permalink
Add snapshot retention E2E test
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Savian <vitor.savian@suse.com>
  • Loading branch information
vitorsavian committed Jun 5, 2024
1 parent 0791a41 commit f472e2d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/e2e/s3/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def provision(vm, role, role_num, node_num)
node-external-ip: #{NETWORK_PREFIX}.100
flannel-iface: eth1
cluster-init: true
etcd-snapshot-schedule-cron: '*/1 * * * *'
etcd-snapshot-retention: 2
etcd-s3-insecure: true
etcd-s3-bucket: test-bucket
etcd-s3-folder: test-folder
Expand Down
7 changes: 7 additions & 0 deletions tests/e2e/s3/s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ var _ = Describe("Verify Create", Ordered, func() {
Expect(err).NotTo(HaveOccurred())
Expect(strings.TrimSpace(res)).To(Equal("4"))
})
It("retention snapshots", func() {
Eventually(func(g Gomega) {
res, err := e2e.RunCmdOnNode("k3s etcd-snapshot ls 2>/dev/null | grep etcd-snapshot | wc -l", serverNodeNames[0])
Expect(err).NotTo(HaveOccurred())
Expect(strings.TrimSpace(res)).To(Equal("4"))
}, "180s", "5s").Should(Succeed())
})
})
})

Expand Down

0 comments on commit f472e2d

Please sign in to comment.