treewide: rename osbase/test/launch to osbase/test/qemu
Change-Id: Ia0775c462c8c909dc2080f01ff1f609b6d099179
Reviewed-on: https://review.monogon.dev/c/monogon/+/4046
Tested-by: Jenkins CI
Reviewed-by: Jan Schär <jan@monogon.tech>
diff --git a/osbase/test/ktest/BUILD.bazel b/osbase/test/ktest/BUILD.bazel
index 0a43ab4..e247ca1 100644
--- a/osbase/test/ktest/BUILD.bazel
+++ b/osbase/test/ktest/BUILD.bazel
@@ -7,7 +7,7 @@
srcs = ["main.go"],
importpath = "source.monogon.dev/osbase/test/ktest",
visibility = ["//visibility:private"],
- deps = ["//osbase/test/launch"],
+ deps = ["//osbase/test/qemu"],
)
go_binary(
diff --git a/osbase/test/ktest/main.go b/osbase/test/ktest/main.go
index 9f17f68..5ed387c 100644
--- a/osbase/test/ktest/main.go
+++ b/osbase/test/ktest/main.go
@@ -13,7 +13,7 @@
"os"
"time"
- "source.monogon.dev/osbase/test/launch"
+ "source.monogon.dev/osbase/test/qemu"
)
var (
@@ -25,7 +25,7 @@
func main() {
flag.Parse()
- hostFeedbackConn, vmFeedbackConn, err := launch.NewSocketPair()
+ hostFeedbackConn, vmFeedbackConn, err := qemu.NewSocketPair()
if err != nil {
log.Fatalf("Failed to create socket pair: %v", err)
}
@@ -42,7 +42,7 @@
exitCodeChan <- returnCode[0]
}()
- if err := launch.RunMicroVM(context.Background(), &launch.MicroVMOptions{
+ if err := qemu.RunMicroVM(context.Background(), &qemu.MicroVMOptions{
Name: "ktest",
KernelPath: *kernelPath,
InitramfsPath: *initrdPath,
diff --git a/osbase/test/launch/log.go b/osbase/test/launch/log.go
deleted file mode 100644
index 4cddd61..0000000
--- a/osbase/test/launch/log.go
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright The Monogon Project Authors.
-// SPDX-License-Identifier: Apache-2.0
-
-package launch
-
-import (
- "fmt"
- "os"
- "strings"
-)
-
-// Log is compatible with the output of ConciseString as used in the Metropolis
-// console log, making the output more readable in unified test logs.
-func Log(f string, args ...any) {
- formatted := fmt.Sprintf(f, args...)
- for i, line := range strings.Split(formatted, "\n") {
- if len(line) == 0 {
- continue
- }
- if i == 0 {
- fmt.Printf("TT| %20s ! %s\n", "test launch", line)
- } else {
- fmt.Printf("TT| %20s | %s\n", "", line)
- }
- }
-}
-
-func Fatal(f string, args ...any) {
- Log(f, args...)
- os.Exit(1)
-}
diff --git a/osbase/test/launch/BUILD.bazel b/osbase/test/qemu/BUILD.bazel
similarity index 64%
rename from osbase/test/launch/BUILD.bazel
rename to osbase/test/qemu/BUILD.bazel
index 3df6b40..f45804f 100644
--- a/osbase/test/launch/BUILD.bazel
+++ b/osbase/test/qemu/BUILD.bazel
@@ -1,12 +1,9 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
- name = "launch",
- srcs = [
- "launch.go",
- "log.go",
- ],
- importpath = "source.monogon.dev/osbase/test/launch",
+ name = "qemu",
+ srcs = ["launch.go"],
+ importpath = "source.monogon.dev/osbase/test/qemu",
visibility = [
"//metropolis:__subpackages__",
"//osbase:__subpackages__",
diff --git a/osbase/test/launch/launch.go b/osbase/test/qemu/launch.go
similarity index 98%
rename from osbase/test/launch/launch.go
rename to osbase/test/qemu/launch.go
index d38df79..52a1492 100644
--- a/osbase/test/launch/launch.go
+++ b/osbase/test/qemu/launch.go
@@ -1,8 +1,8 @@
// Copyright The Monogon Project Authors.
// SPDX-License-Identifier: Apache-2.0
-// launch implements test harnesses for running qemu VMs from tests.
-package launch
+// Package qemu implements test harnesses for running qemu VMs from tests.
+package qemu
import (
"bytes"
@@ -53,7 +53,7 @@
argsFmt += " "
}
}
- Log("Running %s:\n %s\n", name, argsFmt)
+ fmt.Fprintf(os.Stderr, "Running %s:\n %s\n", name, argsFmt)
}
// PortMap represents where VM ports are mapped to on the host. It maps from the VM