mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-30 09:13:29 +00:00
Remove all references to and dependencies on ciao
This commit removes all the references to the ciao project. It also removes some of the dependencies that the unit tests were pulling in. Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
This commit is contained in:
parent
27709fce43
commit
57aafb5638
@ -21,7 +21,7 @@ import (
|
|||||||
|
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/ciao-project/ciao/qemu"
|
"github.com/intel/govmm/qemu"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Example() {
|
func Example() {
|
||||||
|
@ -21,10 +21,11 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ciao-project/ciao/testutil"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const agentUUID = "4cb19522-1e18-439a-883a-f9b2a3a95f5e"
|
||||||
|
const volumeUUID = "67d86208-b46c-4465-9018-e14187d4010"
|
||||||
|
|
||||||
func testAppend(structure interface{}, expected string, t *testing.T) {
|
func testAppend(structure interface{}, expected string, t *testing.T) {
|
||||||
var config Config
|
var config Config
|
||||||
|
|
||||||
@ -141,8 +142,8 @@ func TestAppendDeviceNetwork(t *testing.T) {
|
|||||||
var deviceNetworkStringMq = "-netdev tap,id=tap0,vhost=on,fds=3:4 -device driver=virtio-net-pci,netdev=tap0,mac=01:02:de:ad:be:ef,disable-modern=true,mq=on,vectors=6"
|
var deviceNetworkStringMq = "-netdev tap,id=tap0,vhost=on,fds=3:4 -device driver=virtio-net-pci,netdev=tap0,mac=01:02:de:ad:be:ef,disable-modern=true,mq=on,vectors=6"
|
||||||
|
|
||||||
func TestAppendDeviceNetworkMq(t *testing.T) {
|
func TestAppendDeviceNetworkMq(t *testing.T) {
|
||||||
foo, _ := ioutil.TempFile(os.TempDir(), "qemu-ciao-test")
|
foo, _ := ioutil.TempFile(os.TempDir(), "govmm-qemu-test")
|
||||||
bar, _ := ioutil.TempFile(os.TempDir(), "qemu-ciao-test")
|
bar, _ := ioutil.TempFile(os.TempDir(), "govmm-qemu-test")
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
foo.Close()
|
foo.Close()
|
||||||
@ -191,8 +192,8 @@ func TestAppendDeviceNetworkPCI(t *testing.T) {
|
|||||||
var deviceNetworkPCIStringMq = "-netdev tap,id=tap0,vhost=on,fds=3:4 -device driver=virtio-net-pci,netdev=tap0,mac=01:02:de:ad:be:ef,bus=/pci-bus/pcie.0,addr=ff,disable-modern=true,mq=on,vectors=6"
|
var deviceNetworkPCIStringMq = "-netdev tap,id=tap0,vhost=on,fds=3:4 -device driver=virtio-net-pci,netdev=tap0,mac=01:02:de:ad:be:ef,bus=/pci-bus/pcie.0,addr=ff,disable-modern=true,mq=on,vectors=6"
|
||||||
|
|
||||||
func TestAppendDeviceNetworkPCIMq(t *testing.T) {
|
func TestAppendDeviceNetworkPCIMq(t *testing.T) {
|
||||||
foo, _ := ioutil.TempFile(os.TempDir(), "qemu-ciao-test")
|
foo, _ := ioutil.TempFile(os.TempDir(), "govmm-qemu-test")
|
||||||
bar, _ := ioutil.TempFile(os.TempDir(), "qemu-ciao-test")
|
bar, _ := ioutil.TempFile(os.TempDir(), "govmm-qemu-test")
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
foo.Close()
|
foo.Close()
|
||||||
@ -246,13 +247,13 @@ func TestAppendDeviceSerialPort(t *testing.T) {
|
|||||||
testAppend(chardev, deviceSerialPortString, t)
|
testAppend(chardev, deviceSerialPortString, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
var deviceBlockString = "-device virtio-blk,disable-modern=true,drive=hd0,scsi=off,config-wce=off -drive id=hd0,file=/var/lib/ciao.img,aio=threads,format=qcow2,if=none"
|
var deviceBlockString = "-device virtio-blk,disable-modern=true,drive=hd0,scsi=off,config-wce=off -drive id=hd0,file=/var/lib/vm.img,aio=threads,format=qcow2,if=none"
|
||||||
|
|
||||||
func TestAppendDeviceBlock(t *testing.T) {
|
func TestAppendDeviceBlock(t *testing.T) {
|
||||||
blkdev := BlockDevice{
|
blkdev := BlockDevice{
|
||||||
Driver: VirtioBlock,
|
Driver: VirtioBlock,
|
||||||
ID: "hd0",
|
ID: "hd0",
|
||||||
File: "/var/lib/ciao.img",
|
File: "/var/lib/vm.img",
|
||||||
AIO: Threads,
|
AIO: Threads,
|
||||||
Format: QCOW2,
|
Format: QCOW2,
|
||||||
Interface: NoInterface,
|
Interface: NoInterface,
|
||||||
@ -413,13 +414,13 @@ func TestAppendQMPSocketServer(t *testing.T) {
|
|||||||
testAppend(qmp, qmpSocketServerString, t)
|
testAppend(qmp, qmpSocketServerString, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
var qemuString = "-name cc-qemu -cpu host -uuid " + testutil.AgentUUID
|
var qemuString = "-name cc-qemu -cpu host -uuid " + agentUUID
|
||||||
|
|
||||||
func TestAppendStrings(t *testing.T) {
|
func TestAppendStrings(t *testing.T) {
|
||||||
config := Config{
|
config := Config{
|
||||||
Path: "qemu",
|
Path: "qemu",
|
||||||
Name: "cc-qemu",
|
Name: "cc-qemu",
|
||||||
UUID: testutil.AgentUUID,
|
UUID: agentUUID,
|
||||||
CPUModel: "host",
|
CPUModel: "host",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,8 +28,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/ciao-project/ciao/testutil"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -358,7 +356,7 @@ func TestQMPBlockdevAdd(t *testing.T) {
|
|||||||
q := startQMPLoop(buf, cfg, connectedCh, disconnectedCh)
|
q := startQMPLoop(buf, cfg, connectedCh, disconnectedCh)
|
||||||
q.version = checkVersion(t, connectedCh)
|
q.version = checkVersion(t, connectedCh)
|
||||||
err := q.ExecuteBlockdevAdd(context.Background(), "/dev/rbd0",
|
err := q.ExecuteBlockdevAdd(context.Background(), "/dev/rbd0",
|
||||||
fmt.Sprintf("drive_%s", testutil.VolumeUUID))
|
fmt.Sprintf("drive_%s", volumeUUID))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Unexpected error %v", err)
|
t.Fatalf("Unexpected error %v", err)
|
||||||
}
|
}
|
||||||
@ -380,8 +378,8 @@ func TestQMPDeviceAdd(t *testing.T) {
|
|||||||
cfg := QMPConfig{Logger: qmpTestLogger{}}
|
cfg := QMPConfig{Logger: qmpTestLogger{}}
|
||||||
q := startQMPLoop(buf, cfg, connectedCh, disconnectedCh)
|
q := startQMPLoop(buf, cfg, connectedCh, disconnectedCh)
|
||||||
checkVersion(t, connectedCh)
|
checkVersion(t, connectedCh)
|
||||||
blockdevID := fmt.Sprintf("drive_%s", testutil.VolumeUUID)
|
blockdevID := fmt.Sprintf("drive_%s", volumeUUID)
|
||||||
devID := fmt.Sprintf("device_%s", testutil.VolumeUUID)
|
devID := fmt.Sprintf("device_%s", volumeUUID)
|
||||||
err := q.ExecuteDeviceAdd(context.Background(), blockdevID, devID,
|
err := q.ExecuteDeviceAdd(context.Background(), blockdevID, devID,
|
||||||
"virtio-blk-pci", "")
|
"virtio-blk-pci", "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -406,7 +404,7 @@ func TestQMPXBlockdevDel(t *testing.T) {
|
|||||||
q := startQMPLoop(buf, cfg, connectedCh, disconnectedCh)
|
q := startQMPLoop(buf, cfg, connectedCh, disconnectedCh)
|
||||||
q.version = checkVersion(t, connectedCh)
|
q.version = checkVersion(t, connectedCh)
|
||||||
err := q.ExecuteBlockdevDel(context.Background(),
|
err := q.ExecuteBlockdevDel(context.Background(),
|
||||||
fmt.Sprintf("drive_%s", testutil.VolumeUUID))
|
fmt.Sprintf("drive_%s", volumeUUID))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Unexpected error %v", err)
|
t.Fatalf("Unexpected error %v", err)
|
||||||
}
|
}
|
||||||
@ -427,7 +425,7 @@ func TestQMPDeviceDel(t *testing.T) {
|
|||||||
seconds = 1352167040730
|
seconds = 1352167040730
|
||||||
microsecondsEv1 = 123456
|
microsecondsEv1 = 123456
|
||||||
microsecondsEv2 = 123556
|
microsecondsEv2 = 123556
|
||||||
device = "device_" + testutil.VolumeUUID
|
device = "device_" + volumeUUID
|
||||||
path = "/dev/rbd0"
|
path = "/dev/rbd0"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -470,7 +468,7 @@ func TestQMPDeviceDel(t *testing.T) {
|
|||||||
checkVersion(t, connectedCh)
|
checkVersion(t, connectedCh)
|
||||||
buf.startEventLoop(&wg)
|
buf.startEventLoop(&wg)
|
||||||
err := q.ExecuteDeviceDel(context.Background(),
|
err := q.ExecuteDeviceDel(context.Background(),
|
||||||
fmt.Sprintf("device_%s", testutil.VolumeUUID))
|
fmt.Sprintf("device_%s", volumeUUID))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Unexpected error %v", err)
|
t.Fatalf("Unexpected error %v", err)
|
||||||
}
|
}
|
||||||
@ -499,7 +497,7 @@ func TestQMPDeviceDelTimeout(t *testing.T) {
|
|||||||
checkVersion(t, connectedCh)
|
checkVersion(t, connectedCh)
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
|
||||||
err := q.ExecuteDeviceDel(ctx,
|
err := q.ExecuteDeviceDel(ctx,
|
||||||
fmt.Sprintf("device_%s", testutil.VolumeUUID))
|
fmt.Sprintf("device_%s", volumeUUID))
|
||||||
cancel()
|
cancel()
|
||||||
if err != context.DeadlineExceeded {
|
if err != context.DeadlineExceeded {
|
||||||
t.Fatalf("Timeout expected found %v", err)
|
t.Fatalf("Timeout expected found %v", err)
|
||||||
@ -683,7 +681,7 @@ func TestQMPEvents(t *testing.T) {
|
|||||||
seconds = 1352167040730
|
seconds = 1352167040730
|
||||||
microsecondsEv1 = 123456
|
microsecondsEv1 = 123456
|
||||||
microsecondsEv2 = 123556
|
microsecondsEv2 = 123556
|
||||||
device = "device_" + testutil.VolumeUUID
|
device = "device_" + volumeUUID
|
||||||
path = "/dev/rbd0"
|
path = "/dev/rbd0"
|
||||||
)
|
)
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
@ -721,7 +719,7 @@ func TestQMPEvents(t *testing.T) {
|
|||||||
deviceName := ev.Data["device"].(string)
|
deviceName := ev.Data["device"].(string)
|
||||||
if deviceName != device {
|
if deviceName != device {
|
||||||
t.Errorf("Unexpected device field. Expected %s, found %s",
|
t.Errorf("Unexpected device field. Expected %s, found %s",
|
||||||
"device_"+testutil.VolumeUUID, device)
|
"device_"+volumeUUID, device)
|
||||||
}
|
}
|
||||||
pathName := ev.Data["path"].(string)
|
pathName := ev.Data["path"].(string)
|
||||||
if pathName != path {
|
if pathName != path {
|
||||||
@ -798,8 +796,8 @@ func TestQMPPCIDeviceAdd(t *testing.T) {
|
|||||||
cfg := QMPConfig{Logger: qmpTestLogger{}}
|
cfg := QMPConfig{Logger: qmpTestLogger{}}
|
||||||
q := startQMPLoop(buf, cfg, connectedCh, disconnectedCh)
|
q := startQMPLoop(buf, cfg, connectedCh, disconnectedCh)
|
||||||
checkVersion(t, connectedCh)
|
checkVersion(t, connectedCh)
|
||||||
blockdevID := fmt.Sprintf("drive_%s", testutil.VolumeUUID)
|
blockdevID := fmt.Sprintf("drive_%s", volumeUUID)
|
||||||
devID := fmt.Sprintf("device_%s", testutil.VolumeUUID)
|
devID := fmt.Sprintf("device_%s", volumeUUID)
|
||||||
err := q.ExecutePCIDeviceAdd(context.Background(), blockdevID, devID,
|
err := q.ExecutePCIDeviceAdd(context.Background(), blockdevID, devID,
|
||||||
"virtio-blk-pci", "0x1", "")
|
"virtio-blk-pci", "0x1", "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user