Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Daichi Sakaue <[email protected]>
  • Loading branch information
yokaze committed Sep 26, 2024
1 parent ce9b253 commit 877aea9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 21 deletions.
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

0 comments on commit 877aea9

Please sign in to comment.