Permalink
Please sign in to comment.
Showing
with
234 additions
and 1 deletion.
- +12 −0 docs/docs/reference/resources.md
- +3 −0 pkg/libvirttools/TestContainerLifecycle.out.yaml
- +101 −0 pkg/libvirttools/TestDomainDefinitions__system_UUID.out.yaml
- +1 −0 pkg/libvirttools/TestDomainForcedShutdown.out.yaml
- +23 −1 pkg/libvirttools/virtualization.go
- +6 −0 pkg/libvirttools/virtualization_test.go
- +12 −0 pkg/metadata/types/annotations.go
- +19 −0 pkg/metadata/types/annotations_test.go
- +5 −0 tests/e2e/framework/vm_interface.go
- +52 −0 tests/e2e/systemuuid_test.go
@@ -0,0 +1,101 @@ | |||
- name: GetImagePathDigestAndVirtualSize | |||
value: fake/image1 | |||
- name: 'storage: CreateStoragePool' | |||
value: |- | |||
<pool type="dir"> | |||
<name>volumes</name> | |||
<target> | |||
<path>/var/lib/virtlet/volumes</path> | |||
</target> | |||
</pool> | |||
- name: 'storage: volumes: CreateStorageVol' | |||
value: |- | |||
<volume type="file"> | |||
<name>virtlet_root_53008994-44c0-4017-ad44-9c49758083da</name> | |||
<allocation unit="b">0</allocation> | |||
<capacity unit="b">424242</capacity> | |||
<target> | |||
<format type="qcow2"></format> | |||
</target> | |||
<backingStore> | |||
<path>/fake/volume/path</path> | |||
<format type="qcow2"></format> | |||
</backingStore> | |||
</volume> | |||
- name: 'domain conn: DefineDomain' | |||
value: |- | |||
<domain type="kvm"> | |||
<name>virtlet-53008994-44c0-container1</name> | |||
<uuid>53008994-44c0-4017-ad44-9c49758083da</uuid> | |||
<memory unit="MiB">1024</memory> | |||
<vcpu>1</vcpu> | |||
<cputune> | |||
<shares>0</shares> | |||
<period>0</period> | |||
<quota>0</quota> | |||
</cputune> | |||
<sysinfo type="smbios"> | |||
<system> | |||
<entry name="uuid">53008994-44c0-4017-ad44-9c49758083da</entry> | |||
</system> | |||
</sysinfo> | |||
<os> | |||
<type>hvm</type> | |||
<boot dev="hd"></boot> | |||
</os> | |||
<features> | |||
<acpi></acpi> | |||
</features> | |||
<on_poweroff>destroy</on_poweroff> | |||
<on_reboot>restart</on_reboot> | |||
<on_crash>restart</on_crash> | |||
<devices> | |||
<emulator>/vmwrapper</emulator> | |||
<disk type="file" device="disk"> | |||
<driver name="qemu" type="qcow2"></driver> | |||
<source file="/var/lib/virtlet/volumes/virtlet_root_53008994-44c0-4017-ad44-9c49758083da"></source> | |||
<target dev="sda" bus="scsi"></target> | |||
<address type="drive" controller="0" bus="0" target="0" unit="0"></address> | |||
</disk> | |||
<disk type="file" device="cdrom"> | |||
<driver name="qemu" type="raw"></driver> | |||
<source file="/var/lib/virtlet/config/config-53008994-44c0-4017-ad44-9c49758083da.iso"></source> | |||
<target dev="sdb" bus="scsi"></target> | |||
<readonly></readonly> | |||
<address type="drive" controller="0" bus="0" target="0" unit="1"></address> | |||
</disk> | |||
<controller type="scsi" index="0" model="virtio-scsi"> | |||
<address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"></address> | |||
</controller> | |||
<controller type="pci" model="pci-root"></controller> | |||
<serial type="unix"> | |||
<source mode="connect" path="/var/lib/libvirt/streamer.sock"> | |||
<reconnect enabled="yes" timeout="1"></reconnect> | |||
</source> | |||
<target port="0"></target> | |||
</serial> | |||
<input type="tablet" bus="usb"></input> | |||
<graphics type="vnc" port="-1"></graphics> | |||
<video> | |||
<model type="cirrus"></model> | |||
</video> | |||
</devices> | |||
<commandline xmlns="http://libvirt.org/schemas/domain/qemu/1.0"> | |||
<env name="VIRTLET_EMULATOR" value="/usr/bin/kvm"></env> | |||
<env name="VIRTLET_NET_KEY" value="/tmp/fakenetns"></env> | |||
<env name="VIRTLET_CONTAINER_ID" value="53008994-44c0-4017-ad44-9c49758083da"></env> | |||
<env name="VIRTLET_CONTAINER_LOG_PATH" value="/var/log/pods/69eec606-0493-5825-73a4-c5e0c0236155/container1_42.log"></env> | |||
</commandline> | |||
</domain> | |||
- name: 'domain conn: virtlet-53008994-44c0-container1: Create' | |||
- name: 'domain conn: virtlet-53008994-44c0-container1: iso image' | |||
value: | |||
meta-data: '{"instance-id":"testName_0.default","local-hostname":"testName_0"}' | |||
network-config: | | |||
version: 1 | |||
user-data: | | |||
#cloud-config | |||
- name: 'domain conn: virtlet-53008994-44c0-container1: Destroy' | |||
- name: 'domain conn: virtlet-53008994-44c0-container1: Undefine' | |||
- name: 'storage: volumes: RemoveVolumeByName' | |||
value: virtlet_root_53008994-44c0-4017-ad44-9c49758083da |
@@ -0,0 +1,52 @@ | |||
/* | |||
Copyright 2019 Mirantis | |||
Licensed under the Apache License, Version 2.0 (the "License"); | |||
you may not use this file except in compliance with the License. | |||
You may obtain a copy of the License at | |||
http://www.apache.org/licenses/LICENSE-2.0 | |||
Unless required by applicable law or agreed to in writing, software | |||
distributed under the License is distributed on an "AS IS" BASIS, | |||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
See the License for the specific language governing permissions and | |||
limitations under the License. | |||
*/ | |||
|
|||
package e2e | |||
|
|||
import ( | |||
"time" | |||
|
|||
. "github.com/onsi/gomega" | |||
|
|||
"github.com/Mirantis/virtlet/tests/e2e/framework" | |||
. "github.com/Mirantis/virtlet/tests/e2e/ginkgo-ext" | |||
) | |||
|
|||
var _ = Describe("SystemUUID passing", func() { | |||
var ( | |||
vm *framework.VMInterface | |||
ssh framework.Executor | |||
) | |||
|
|||
BeforeAll(func() { | |||
vm = controller.VM("uuid") | |||
Expect(vm.CreateAndWait(VMOptions{ | |||
SystemUUID: "53008994-44c0-4017-ad44-9c49758083da", | |||
}.ApplyDefaults(), time.Minute*5, nil)).To(Succeed()) | |||
do(vm.Pod()) | |||
}) | |||
|
|||
AfterAll(func() { | |||
deleteVM(vm) | |||
}) | |||
|
|||
scheduleWaitSSH(&vm, &ssh) | |||
|
|||
It("Should have the specified SMBIOS UUID set [Conformance]", func() { | |||
uuid := do(framework.RunSimple(ssh, "sudo", "cat", "/sys/class/dmi/id/product_uuid")).(string) | |||
Expect(uuid).To(Equal("53008994-44C0-4017-AD44-9C49758083DA")) | |||
}) | |||
}) |
0 comments on commit
dad0dc7