force stopping kubelet to unmount lv volumes
@@ -277,7 +277,13 @@ spec:
It("should stop undeleted container in case that the container is undeleted", func() {
stdout, stderr, err := execAtLocal(
- "docker", nil, "exec", "-i", "topolvm-e2e-worker3",
+ "docker", nil, "exec", "topolvm-e2e-worker3",
+ "systemctl", "stop", "kubelet.service",
+ )
+ Expect(err).ShouldNot(HaveOccurred(), "stdout=%s, stderr=%s", stdout, stderr)
+
+ stdout, stderr, err = execAtLocal(
+ "docker", nil, "exec", "topolvm-e2e-worker3",
"/usr/local/bin/crictl", "ps", "-o=json",
)
Expect(err).ShouldNot(HaveOccurred(), "stdout=%s, stderr=%s", stdout, stderr)
@@ -295,15 +301,13 @@ spec:
Expect(err).ShouldNot(HaveOccurred(), "stdout=%s", stdout)
for _, c := range l.Containers {
- if c.Metadata.Name == "ubuntu" {
stdout, stderr, err = execAtLocal(
"docker", nil,
- "exec", "-i", "topolvm-e2e-worker3", "/usr/local/bin/crictl", "stop", c.ID,
+ "exec", "topolvm-e2e-worker3", "/usr/local/bin/crictl", "stop", c.ID,
)
Expect(err).ShouldNot(HaveOccurred(), "stdout=%s, stderr=%s", stdout, stderr)
fmt.Printf("stop ubuntu container with id=%s\n", c.ID)
}
- }
})
It("should cleanup volumes", func() {
