]> git.ipfire.org Git - nitsi.git/commitdiff
Move tests and virtual environment example into examples subfolder
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Fri, 11 May 2018 12:29:58 +0000 (14:29 +0200)
committerJonatan Schlag <jonatan.schlag@ipfire.org>
Fri, 11 May 2018 12:29:58 +0000 (14:29 +0200)
Fixes: #11723
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
13 files changed:
examples/test/recipe [new file with mode: 0644]
examples/test/settings [new file with mode: 0644]
examples/test2/recipe [new file with mode: 0644]
examples/test2/settings [new file with mode: 0644]
examples/test3/recipe [new file with mode: 0644]
examples/test3/settings [new file with mode: 0644]
examples/virtual-environment/basic/machines/alice/machine.xml [new file with mode: 0644]
examples/virtual-environment/basic/machines/alice/snapshot.xml [new file with mode: 0644]
examples/virtual-environment/basic/machines/bob/machine.xml [new file with mode: 0644]
examples/virtual-environment/basic/machines/bob/snapshot.xml [new file with mode: 0644]
examples/virtual-environment/basic/network/network1/network.xml [new file with mode: 0644]
examples/virtual-environment/basic/network/network2/network.xml [new file with mode: 0644]
examples/virtual-environment/basic/settings [new file with mode: 0644]

diff --git a/examples/test/recipe b/examples/test/recipe
new file mode 100644 (file)
index 0000000..c035b97
--- /dev/null
@@ -0,0 +1,6 @@
+alice: echo "Hello World"
+bob: echo "Hello World"
+alice: ls -l
+all: blkid
+alice,bob !: eecho "This is a comma seperated list"
+include: ../test2
diff --git a/examples/test/settings b/examples/test/settings
new file mode 100644 (file)
index 0000000..d390dc0
--- /dev/null
@@ -0,0 +1,12 @@
+[DEFAULT]
+Name = Hello World
+Description = This is a
+    short description.
+
+Copy_from =
+Copy_to = /root/
+
+[VIRTUAL_ENVIRONMENT]
+Name = basic
+path = ../virtual-environment/basic
+
diff --git a/examples/test2/recipe b/examples/test2/recipe
new file mode 100644 (file)
index 0000000..7f96a65
--- /dev/null
@@ -0,0 +1,2 @@
+alice: echo "This is test2 on alice"
+include: ../test3
diff --git a/examples/test2/settings b/examples/test2/settings
new file mode 100644 (file)
index 0000000..616e1a0
--- /dev/null
@@ -0,0 +1,9 @@
+[DEFAULT]
+Name = Hello World
+Description = This is a
+    short description.
+
+[VIRTUAL_ENVIRONMENT]
+Name = basic
+path = ../virtual-environment/basic
+
diff --git a/examples/test3/recipe b/examples/test3/recipe
new file mode 100644 (file)
index 0000000..5382623
--- /dev/null
@@ -0,0 +1,2 @@
+alice: echo "This is test3 on alice"
+all: echo "This is test3 on all"
\ No newline at end of file
diff --git a/examples/test3/settings b/examples/test3/settings
new file mode 100644 (file)
index 0000000..616e1a0
--- /dev/null
@@ -0,0 +1,9 @@
+[DEFAULT]
+Name = Hello World
+Description = This is a
+    short description.
+
+[VIRTUAL_ENVIRONMENT]
+Name = basic
+path = ../virtual-environment/basic
+
diff --git a/examples/virtual-environment/basic/machines/alice/machine.xml b/examples/virtual-environment/basic/machines/alice/machine.xml
new file mode 100644 (file)
index 0000000..2f7d0f5
--- /dev/null
@@ -0,0 +1,111 @@
+<domain type='kvm'>
+  <name>alice</name>
+  <uuid>76eb4b45-158b-435d-84eb-0bdc0aafd1f8</uuid>
+  <memory unit='KiB'>1048576</memory>
+  <currentMemory unit='KiB'>1048576</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64' machine='pc-i440fx-2.8'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <features>
+    <acpi/>
+    <apic/>
+    <vmport state='off'/>
+  </features>
+  <cpu mode='custom' match='exact'>
+    <model fallback='allow'>Broadwell-noTSX</model>
+  </cpu>
+  <clock offset='utc'>
+    <timer name='rtc' tickpolicy='catchup'/>
+    <timer name='pit' tickpolicy='delay'/>
+    <timer name='hpet' present='no'/>
+  </clock>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
+  <pm>
+    <suspend-to-mem enabled='no'/>
+    <suspend-to-disk enabled='no'/>
+  </pm>
+  <devices>
+    <emulator>/usr/bin/kvm</emulator>
+    <disk type='file' device='disk'>
+      <driver name='qemu' type='qcow2'/>
+      <source file='/var/lib/libvirt/images/alice.qcow2'/>
+      <target dev='vda' bus='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
+    </disk>
+    <controller type='usb' index='0' model='ich9-ehci1'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x7'/>
+    </controller>
+    <controller type='usb' index='0' model='ich9-uhci1'>
+      <master startport='0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0' multifunction='on'/>
+    </controller>
+    <controller type='usb' index='0' model='ich9-uhci2'>
+      <master startport='2'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x1'/>
+    </controller>
+    <controller type='usb' index='0' model='ich9-uhci3'>
+      <master startport='4'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x2'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'/>
+    <controller type='virtio-serial' index='0'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
+    </controller>
+    <interface type='network'>
+      <mac address='52:54:00:8a:b8:b5'/>
+      <source network='net1'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+    <interface type='network'>
+      <mac address='52:54:00:ea:62:65'/>
+      <source network='net2'/>
+      <model type='rtl8139'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+    </interface>
+    <serial type='pty'>
+      <target port='0'/>
+    </serial>
+    <console type='pty'>
+      <target type='serial' port='0'/>
+    </console>
+    <channel type='unix'>
+      <target type='virtio' name='org.qemu.guest_agent.0'/>
+      <address type='virtio-serial' controller='0' bus='0' port='1'/>
+    </channel>
+    <channel type='spicevmc'>
+      <target type='virtio' name='com.redhat.spice.0'/>
+      <address type='virtio-serial' controller='0' bus='0' port='2'/>
+    </channel>
+    <input type='tablet' bus='usb'>
+      <address type='usb' bus='0' port='1'/>
+    </input>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <graphics type='spice' autoport='yes'>
+      <listen type='address'/>
+      <image compression='off'/>
+    </graphics>
+    <sound model='ich6'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
+    </sound>
+    <video>
+      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+    </video>
+    <redirdev bus='usb' type='spicevmc'>
+      <address type='usb' bus='0' port='2'/>
+    </redirdev>
+    <redirdev bus='usb' type='spicevmc'>
+      <address type='usb' bus='0' port='3'/>
+    </redirdev>
+    <memballoon model='virtio'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
+    </memballoon>
+  </devices>
+</domain>
+
diff --git a/examples/virtual-environment/basic/machines/alice/snapshot.xml b/examples/virtual-environment/basic/machines/alice/snapshot.xml
new file mode 100644 (file)
index 0000000..e996246
--- /dev/null
@@ -0,0 +1,8 @@
+<domainsnapshot>
+  <description>Snapshot to undo all changes from this test</description>
+  <memory>no</memory>
+  <disks>
+    <disk name='/var/lib/libvirt/images/alice.qcow2'>
+    </disk>
+  </disks>
+</domainsnapshot>
diff --git a/examples/virtual-environment/basic/machines/bob/machine.xml b/examples/virtual-environment/basic/machines/bob/machine.xml
new file mode 100644 (file)
index 0000000..0ec99ae
--- /dev/null
@@ -0,0 +1,111 @@
+<domain type='kvm'>
+  <name>bob</name>
+  <uuid>b411a615-d6af-41cb-9b30-aaf9a8c52d51</uuid>
+  <memory unit='KiB'>1048576</memory>
+  <currentMemory unit='KiB'>1048576</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64' machine='pc-i440fx-2.8'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <features>
+    <acpi/>
+    <apic/>
+    <vmport state='off'/>
+  </features>
+  <cpu mode='custom' match='exact'>
+    <model fallback='allow'>Broadwell-noTSX</model>
+  </cpu>
+  <clock offset='utc'>
+    <timer name='rtc' tickpolicy='catchup'/>
+    <timer name='pit' tickpolicy='delay'/>
+    <timer name='hpet' present='no'/>
+  </clock>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
+  <pm>
+    <suspend-to-mem enabled='no'/>
+    <suspend-to-disk enabled='no'/>
+  </pm>
+  <devices>
+    <emulator>/usr/bin/kvm</emulator>
+    <disk type='file' device='disk'>
+      <driver name='qemu' type='qcow2'/>
+      <source file='/var/lib/libvirt/images/bob.qcow2'/>
+      <target dev='vda' bus='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
+    </disk>
+    <controller type='usb' index='0' model='ich9-ehci1'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x7'/>
+    </controller>
+    <controller type='usb' index='0' model='ich9-uhci1'>
+      <master startport='0'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0' multifunction='on'/>
+    </controller>
+    <controller type='usb' index='0' model='ich9-uhci2'>
+      <master startport='2'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x1'/>
+    </controller>
+    <controller type='usb' index='0' model='ich9-uhci3'>
+      <master startport='4'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x2'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'/>
+    <controller type='virtio-serial' index='0'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
+    </controller>
+    <interface type='network'>
+      <mac address='52:54:00:36:ba:7d'/>
+      <source network='net1'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+    <interface type='network'>
+      <mac address='52:54:00:e3:cb:28'/>
+      <source network='net2'/>
+      <model type='rtl8139'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+    </interface>
+    <serial type='pty'>
+      <target port='0'/>
+    </serial>
+    <console type='pty'>
+      <target type='serial' port='0'/>
+    </console>
+    <channel type='unix'>
+      <target type='virtio' name='org.qemu.guest_agent.0'/>
+      <address type='virtio-serial' controller='0' bus='0' port='1'/>
+    </channel>
+    <channel type='spicevmc'>
+      <target type='virtio' name='com.redhat.spice.0'/>
+      <address type='virtio-serial' controller='0' bus='0' port='2'/>
+    </channel>
+    <input type='tablet' bus='usb'>
+      <address type='usb' bus='0' port='1'/>
+    </input>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <graphics type='spice' autoport='yes'>
+      <listen type='address'/>
+      <image compression='off'/>
+    </graphics>
+    <sound model='ich6'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
+    </sound>
+    <video>
+      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+    </video>
+    <redirdev bus='usb' type='spicevmc'>
+      <address type='usb' bus='0' port='2'/>
+    </redirdev>
+    <redirdev bus='usb' type='spicevmc'>
+      <address type='usb' bus='0' port='3'/>
+    </redirdev>
+    <memballoon model='virtio'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
+    </memballoon>
+  </devices>
+</domain>
+
diff --git a/examples/virtual-environment/basic/machines/bob/snapshot.xml b/examples/virtual-environment/basic/machines/bob/snapshot.xml
new file mode 100644 (file)
index 0000000..ec8b1a4
--- /dev/null
@@ -0,0 +1,8 @@
+<domainsnapshot>
+  <description>Snapshot to undo all changes from this test</description>
+  <memory>no</memory>
+  <disks>
+    <disk name='/var/lib/libvirt/images/bob.qcow2'>
+    </disk>
+  </disks>
+</domainsnapshot>
diff --git a/examples/virtual-environment/basic/network/network1/network.xml b/examples/virtual-environment/basic/network/network1/network.xml
new file mode 100644 (file)
index 0000000..7495723
--- /dev/null
@@ -0,0 +1,8 @@
+<network>
+  <name>net1</name>
+  <uuid>c2c82218-4aff-466a-bc20-57f723d6ce3d</uuid>
+  <bridge name='virbr4' stp='on' delay='0'/>
+  <mac address='52:54:00:c4:0c:3b'/>
+  <domain name='net1'/>
+</network>
+
diff --git a/examples/virtual-environment/basic/network/network2/network.xml b/examples/virtual-environment/basic/network/network2/network.xml
new file mode 100644 (file)
index 0000000..366fa74
--- /dev/null
@@ -0,0 +1,8 @@
+<network>
+  <name>net2</name>
+  <uuid>36d10800-09f3-43a7-b99f-3200722393eb</uuid>
+  <bridge name='virbr5' stp='on' delay='0'/>
+  <mac address='52:54:00:28:54:45'/>
+  <domain name='net2'/>
+</network>
+
diff --git a/examples/virtual-environment/basic/settings b/examples/virtual-environment/basic/settings
new file mode 100644 (file)
index 0000000..37735df
--- /dev/null
@@ -0,0 +1,27 @@
+[DEFAULT]
+name = Basic
+machines = alice, bob
+networks = network1, network2
+uri = qemu:///system
+
+[alice]
+xml_file = machines/alice/machine.xml
+snapshot_xml_file = machines/alice/snapshot.xml
+image = /var/lib/libvirt/images/alice.qcow2
+root_uid = 45598e92-3487-4a1b-961d-79aa3dd42a7d
+username = root
+password = 25814@root
+
+[bob]
+xml_file = machines/bob/machine.xml
+snapshot_xml_file = machines/bob/snapshot.xml
+image = /var/lib/libvirt/images/bob.qcow2
+root_uid = 45598e92-3487-4a1b-961d-79aa3dd42a7d
+username = root
+password = 25814@root
+
+[network1]
+xml_file = network/network1/network.xml
+
+[network2]
+xml_file = network/network2/network.xml
\ No newline at end of file