Unverified Commit d349c9db authored by Vitor Savian's avatar Vitor Savian Committed by GitHub

Added cluster reset from non bootstrap nodes on snapshot restore e2e test

parent d0ab4ef2
...@@ -28,8 +28,6 @@ def provision(vm, role, role_num, node_num) ...@@ -28,8 +28,6 @@ def provision(vm, role, role_num, node_num)
install_type = getInstallType(vm, RELEASE_VERSION, GITHUB_BRANCH) install_type = getInstallType(vm, RELEASE_VERSION, GITHUB_BRANCH)
vm.provision "shell", inline: "ping -c 2 k3s.io" vm.provision "shell", inline: "ping -c 2 k3s.io"
db_type = getDBType(role, role_num, vm)
if role.include?("server") && role_num == 0 if role.include?("server") && role_num == 0
vm.provision 'k3s-primary-server', type: 'k3s', run: 'once' do |k3s| vm.provision 'k3s-primary-server', type: 'k3s', run: 'once' do |k3s|
......
...@@ -124,6 +124,7 @@ var _ = Describe("Verify snapshots and cluster restores work", Ordered, func() { ...@@ -124,6 +124,7 @@ var _ = Describe("Verify snapshots and cluster restores work", Ordered, func() {
}) })
}) })
Context("Cluster is reset normally", func() { Context("Cluster is reset normally", func() {
It("Resets the cluster", func() { It("Resets the cluster", func() {
for _, nodeName := range serverNodeNames { for _, nodeName := range serverNodeNames {
...@@ -144,6 +145,17 @@ var _ = Describe("Verify snapshots and cluster restores work", Ordered, func() { ...@@ -144,6 +145,17 @@ var _ = Describe("Verify snapshots and cluster restores work", Ordered, func() {
Expect(e2e.RunCmdOnNode(cmd, serverNodeNames[0])).Error().NotTo(HaveOccurred()) Expect(e2e.RunCmdOnNode(cmd, serverNodeNames[0])).Error().NotTo(HaveOccurred())
}) })
It("Resets non boostrap nodes", func() {
for _, nodeName := range serverNodeNames {
if nodeName != serverNodeNames[0] {
cmd := "k3s server --cluster-reset"
response, err := e2e.RunCmdOnNode(cmd, nodeName)
Expect(err).NotTo(HaveOccurred())
Expect(response).Should(ContainSubstring("Managed etcd cluster membership has been reset, restart without --cluster-reset flag now"))
}
}
})
It("Checks that other servers are not ready", func() { It("Checks that other servers are not ready", func() {
fmt.Printf("\nFetching node status\n") fmt.Printf("\nFetching node status\n")
Eventually(func(g Gomega) { Eventually(func(g Gomega) {
...@@ -209,6 +221,7 @@ var _ = Describe("Verify snapshots and cluster restores work", Ordered, func() { ...@@ -209,6 +221,7 @@ var _ = Describe("Verify snapshots and cluster restores work", Ordered, func() {
}) })
}) })
Context("Cluster restores from snapshot", func() { Context("Cluster restores from snapshot", func() {
It("Restores the snapshot", func() { It("Restores the snapshot", func() {
//Stop k3s on all nodes //Stop k3s on all nodes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment