From ded859aeddefd2ef6f78bf3e64a6760bfb9adc98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20L=C3=BCke?= Date: Thu, 30 Jul 2020 16:34:46 +0200 Subject: [PATCH 1/4] platform/machine/qemu: Log IP address in debug mode --- platform/machine/qemu/cluster.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/machine/qemu/cluster.go b/platform/machine/qemu/cluster.go index 5a906aa2c..ff88c360d 100644 --- a/platform/machine/qemu/cluster.go +++ b/platform/machine/qemu/cluster.go @@ -118,7 +118,7 @@ func (qc *Cluster) NewMachineWithOptions(userdata *conf.UserData, options platfo fdnum += 1 extraFiles = append(extraFiles, tap.File) - plog.Debugf("NewMachine: %q", qmCmd) + plog.Debugf("NewMachine: %q, %q, %q", qmCmd, qm.IP(), qm.PrivateIP()) qm.qemu = qm.qc.NewCommand(qmCmd[0], qmCmd[1:]...) From 881b9fb033466cb3c4f1f912dc31691ee04db84c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20L=C3=BCke?= Date: Thu, 30 Jul 2020 16:37:11 +0200 Subject: [PATCH 2/4] platform/machine/unprivqemu: Log localhost port for SSH connections --- platform/machine/unprivqemu/cluster.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/machine/unprivqemu/cluster.go b/platform/machine/unprivqemu/cluster.go index a87382c73..1c1602b8d 100644 --- a/platform/machine/unprivqemu/cluster.go +++ b/platform/machine/unprivqemu/cluster.go @@ -131,6 +131,8 @@ func (qc *Cluster) NewMachineWithOptions(userdata *conf.UserData, options platfo return nil, err } + plog.Debugf("Localhost port for SSH connections: %q", qm.ip) + if err := platform.StartMachine(qm, qm.journal); err != nil { qm.Destroy() return nil, err From 6aca7a16a7533b149f9d33d160c77ab00e8d900b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20L=C3=BCke?= Date: Thu, 30 Jul 2020 16:48:46 +0200 Subject: [PATCH 3/4] Log PIDs of qemu machine processes for manual cleanup --- platform/local/dnsmasq.go | 2 ++ platform/machine/qemu/cluster.go | 2 ++ platform/machine/unprivqemu/cluster.go | 2 ++ 3 files changed, 6 insertions(+) diff --git a/platform/local/dnsmasq.go b/platform/local/dnsmasq.go index 64f4d7bfb..e30fbc518 100644 --- a/platform/local/dnsmasq.go +++ b/platform/local/dnsmasq.go @@ -187,6 +187,8 @@ func NewDnsmasq() (*Dnsmasq, error) { return nil, err } + plog.Debugf("dnsmasq PID (manual cleanup needed if --remove=false): %v", dm.dnsmasq.Pid()) + var configTemplate *template.Template if plog.LevelAt(capnslog.DEBUG) { diff --git a/platform/machine/qemu/cluster.go b/platform/machine/qemu/cluster.go index ff88c360d..aa7f60111 100644 --- a/platform/machine/qemu/cluster.go +++ b/platform/machine/qemu/cluster.go @@ -133,6 +133,8 @@ func (qc *Cluster) NewMachineWithOptions(userdata *conf.UserData, options platfo return nil, err } + plog.Debugf("qemu PID (manual cleanup needed if --remove=false): %v", qm.qemu.Pid()) + if err := platform.StartMachine(qm, qm.journal); err != nil { qm.Destroy() return nil, err diff --git a/platform/machine/unprivqemu/cluster.go b/platform/machine/unprivqemu/cluster.go index 1c1602b8d..baff9c048 100644 --- a/platform/machine/unprivqemu/cluster.go +++ b/platform/machine/unprivqemu/cluster.go @@ -118,6 +118,8 @@ func (qc *Cluster) NewMachineWithOptions(userdata *conf.UserData, options platfo return nil, err } + plog.Debugf("qemu PID (manual cleanup needed if --remove=false): %v", qm.qemu.Pid()) + pid := strconv.Itoa(qm.qemu.Pid()) err = util.Retry(6, 5*time.Second, func() error { var err error From 79fd1ccce6f5e2291a3f16f08121355ebb855047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20L=C3=BCke?= Date: Thu, 30 Jul 2020 16:59:07 +0200 Subject: [PATCH 4/4] kola: Remove unnecessary deletion of test machines The cluster deletes all machines if needed. Deleting them inside the tests broke the --remove=false flag to keep machines for debugging. --- kola/tests/misc/nfs.go | 4 ---- kola/tests/misc/ntp.go | 1 - kola/tests/systemd/journald.go | 2 -- 3 files changed, 7 deletions(-) diff --git a/kola/tests/misc/nfs.go b/kola/tests/misc/nfs.go index 054035c72..c136f6f92 100644 --- a/kola/tests/misc/nfs.go +++ b/kola/tests/misc/nfs.go @@ -79,8 +79,6 @@ func testNFS(c cluster.TestCluster, nfsversion int, remotePath string) { c.Fatalf("Cluster.NewMachine: %s", err) } - defer m1.Destroy() - c.Log("NFS server booted.") /* poke a file in /tmp */ @@ -126,8 +124,6 @@ systemd: c.Fatalf("Cluster.NewMachine: %s", err) } - defer m2.Destroy() - c.Log("NFS client booted.") checkmount := func() error { diff --git a/kola/tests/misc/ntp.go b/kola/tests/misc/ntp.go index d9990e95e..df5eabc7d 100644 --- a/kola/tests/misc/ntp.go +++ b/kola/tests/misc/ntp.go @@ -47,7 +47,6 @@ func NTP(c cluster.TestCluster) { if err != nil { c.Fatalf("Cluster.NewMachine: %s", err) } - defer m.Destroy() out := c.MustSSH(m, "networkctl status eth0") if !bytes.Contains(out, []byte("NTP: 10.0.0.1")) { diff --git a/kola/tests/systemd/journald.go b/kola/tests/systemd/journald.go index b5f2b3918..765b9f381 100644 --- a/kola/tests/systemd/journald.go +++ b/kola/tests/systemd/journald.go @@ -75,7 +75,6 @@ func journalRemote(c cluster.TestCluster) { if err != nil { c.Fatalf("Cluster.NewMachine: %s", err) } - defer gateway.Destroy() // log a unique message on gatewayd machine msg := "supercalifragilisticexpialidocious" @@ -86,7 +85,6 @@ func journalRemote(c cluster.TestCluster) { if err != nil { c.Fatalf("Cluster.NewMachine: %s", err) } - defer collector.Destroy() // collect logs from gatewayd machine cmd := fmt.Sprintf("sudo systemd-run --unit systemd-journal-remote-client /usr/lib/systemd/systemd-journal-remote --url http://%s:19531", gateway.PrivateIP())