aboutsummaryrefslogtreecommitdiff
path: root/pkg/machine/qemu/config_test.go
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2022-04-26 16:04:57 -0500
committerBrent Baude <bbaude@redhat.com>2022-04-28 13:32:21 -0500
commit2902d32c4989a6c391d713fab7eb567eaac9d4cb (patch)
tree22d3006d7ea6af3b4a5e97e7ff1ab61cf9a8076b /pkg/machine/qemu/config_test.go
parentf722879d3b9ad038f2bf84017c8343f19806a11e (diff)
downloadpodman-2902d32c4989a6c391d713fab7eb567eaac9d4cb.tar.gz
podman-2902d32c4989a6c391d713fab7eb567eaac9d4cb.tar.bz2
podman-2902d32c4989a6c391d713fab7eb567eaac9d4cb.zip
Refactor machine inspect
I was asked to refactor machine inspect output to represent more common and basic information. machine inspect now has information that would be appropriate for different machines. [NO NEW TESTS NEEDED] Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/machine/qemu/config_test.go')
-rw-r--r--pkg/machine/qemu/config_test.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/pkg/machine/qemu/config_test.go b/pkg/machine/qemu/config_test.go
index 264de9ae8..0fbb5b3bf 100644
--- a/pkg/machine/qemu/config_test.go
+++ b/pkg/machine/qemu/config_test.go
@@ -6,6 +6,7 @@ import (
"reflect"
"testing"
+ "github.com/containers/podman/v4/pkg/machine"
"github.com/containers/podman/v4/test/utils"
)
@@ -37,7 +38,7 @@ func TestMachineFile_GetPath(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
- m := &MachineFile{
+ m := &machine.VMFile{
Path: tt.fields.Path, //nolint: scopelint
Symlink: tt.fields.Symlink, //nolint: scopelint
}
@@ -73,7 +74,7 @@ func TestNewMachineFile(t *testing.T) {
sym := "my.sock"
longSym := filepath.Join(homedir, ".podman", sym)
- m := MachineFile{
+ m := machine.VMFile{
Path: p,
Symlink: nil,
}
@@ -84,7 +85,7 @@ func TestNewMachineFile(t *testing.T) {
tests := []struct {
name string
args args
- want *MachineFile
+ want *machine.VMFile
wantErr bool
}{
{
@@ -96,7 +97,7 @@ func TestNewMachineFile(t *testing.T) {
{
name: "Good with short symlink",
args: args{p, &sym},
- want: &MachineFile{p, nil},
+ want: &machine.VMFile{Path: p},
wantErr: false,
},
{
@@ -114,14 +115,14 @@ func TestNewMachineFile(t *testing.T) {
{
name: "Good with long symlink",
args: args{longp, &sym},
- want: &MachineFile{longp, &longSym},
+ want: &machine.VMFile{Path: longp, Symlink: &longSym},
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
- got, err := NewMachineFile(tt.args.path, tt.args.symlink) //nolint: scopelint
- if (err != nil) != tt.wantErr { //nolint: scopelint
+ got, err := machine.NewMachineFile(tt.args.path, tt.args.symlink) //nolint: scopelint
+ if (err != nil) != tt.wantErr { //nolint: scopelint
t.Errorf("NewMachineFile() error = %v, wantErr %v", err, tt.wantErr) //nolint: scopelint
return
}