Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: retry neco bmc config set bmc-user #2631

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions dctest/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,14 @@ func execRetryAt(host string, handler retryHandler, args ...string) []byte {
stdout, stderr, err = execAt(host, args...)
if err != nil {
msg := fmt.Sprintf("stdout: %s, stderr: %s, err: %v", string(stdout), string(stderr), err)
if handler(string(stdout), string(stderr), err) {
stdout := execSafeGomegaAt(g, host, "docker", "ps")
fmt.Println(string(stdout))
stdout = execSafeGomegaAt(g, host, "docker", "inspect", "etcd")
fmt.Println(string(stdout))

StopTrying("retry aborted. " + msg).Wrap(err).Now()
}
if !handler(string(stdout), string(stderr), err) {
StopTrying("retry skipped. " + msg).Wrap(err).Now()
}
Expand Down
2 changes: 2 additions & 0 deletions dctest/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ WantedBy=multi-user.target`
mountServicePath := "/lib/systemd/system/home-cybozu-.kube.mount"

for _, v := range bootServers {
execSafeAt(v, "sudo", "systemd-analyze", "set-log-level", "debug")

stdout, stderr, err := execAtWithInput(v, []byte(mountUnit), "sudo", "tee", mountServicePath)
Expect(err).NotTo(HaveOccurred(), "host=%s, stdout=%s, stderr=%s, err=%v", v, stdout, stderr, err)
execSafeAt(v, "test", "-f", mountServicePath)
Expand Down
44 changes: 23 additions & 21 deletions dctest/suites_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,29 @@ var bootstrapSuite = func() {
Context("setup", testSetup)
Context("initialize", testInit)
Context("sabakan", testSabakan)
Context("machines", testMachines)
Context("init-data", testInitData)
Context("etcdpasswd", testEtcdpasswd)
Context("sabakan-state-setter", testSabakanStateSetter)
Context("ignitions", testIgnitions)
Context("cke", func() {
testCKESetup()
testCKE()
testCKEBackupMetrics()
})
Context("neco-rebooter", testNecoRebooter)
Context("coil", func() {
testCoilSetup()
testCoil()
})
Context("cilium", testCilium)
Context("unbound", testUnbound)
Context("squid", testSquid)
Context("node DNS", testNodeDNS)
Context("l4lb", testL4LB)
Context("tools", testTools)
if false {
Context("machines", testMachines)
Context("init-data", testInitData)
Context("etcdpasswd", testEtcdpasswd)
Context("sabakan-state-setter", testSabakanStateSetter)
Context("ignitions", testIgnitions)
Context("cke", func() {
testCKESetup()
testCKE()
testCKEBackupMetrics()
})
Context("neco-rebooter", testNecoRebooter)
Context("coil", func() {
testCoilSetup()
testCoil()
})
Context("cilium", testCilium)
Context("unbound", testUnbound)
Context("squid", testSquid)
Context("node DNS", testNodeDNS)
Context("l4lb", testL4LB)
Context("tools", testTools)
}
}

// functionsSuite is a test suite that tests a full set of functions of Neco in a single version
Expand Down