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

Improve QEMU debugging #121

Merged
merged 4 commits into from
Jul 31, 2020
Merged
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
4 changes: 0 additions & 4 deletions kola/tests/misc/nfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -126,8 +124,6 @@ systemd:
c.Fatalf("Cluster.NewMachine: %s", err)
}

defer m2.Destroy()

c.Log("NFS client booted.")

checkmount := func() error {
Expand Down
1 change: 0 additions & 1 deletion kola/tests/misc/ntp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down
2 changes: 0 additions & 2 deletions kola/tests/systemd/journald.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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())
Expand Down
2 changes: 2 additions & 0 deletions platform/local/dnsmasq.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion platform/machine/qemu/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:]...)

Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions platform/machine/unprivqemu/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -131,6 +133,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
Expand Down