Merge ~lvoytek/ubuntu/+source/ipmitool:ipmitool-add-dep8 into ubuntu/+source/ipmitool:ubuntu/devel

Proposed by Lena Voytek
Status: Merged
Approved by: git-ubuntu bot
Approved revision: not available
Merged at revision: a94ec47c3ae13fd8ff92b2d161bedc72cdc06e15
Proposed branch: ~lvoytek/ubuntu/+source/ipmitool:ipmitool-add-dep8
Merge into: ubuntu/+source/ipmitool:ubuntu/devel
Diff against target: 152 lines (+120/-0)
5 files modified
debian/changelog (+9/-0)
debian/tests/control (+16/-0)
debian/tests/qemuvbmc (+55/-0)
debian/tests/smoke (+8/-0)
debian/tests/vbmc-qemu-vm-session.xml (+32/-0)
Reviewer Review Type Date Requested Status
git-ubuntu bot Approve
Andreas Hasenack Approve
Canonical Server Pending
Canonical Server Reporter Pending
Review via email: mp+427443@code.launchpad.net

Description of the change

Adding dep-8 test suite to help with ipmitool mir

PPA: https://launchpad.net/~lvoytek/+archive/ubuntu/ipmitool-add-dep8

ppa autopkgtest results (on amd64):

autopkgtest [08:54:30]: @@@@@@@@@@@@@@@@@@@@ summary
smoke PASS
qemuvbmc PASS

qemuvbmc test is skipped on other architectures

To post a comment you must log in.
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I'll look at this.

Revision history for this message
Andreas Hasenack (ahasenack) :
review: Needs Information
Revision history for this message
Lena Voytek (lvoytek) :
Revision history for this message
Lena Voytek (lvoytek) :
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I thi

Revision history for this message
Lena Voytek (lvoytek) wrote :

I'll look into what it will take to get virtualbmc setup as a deb package in ubuntu. If it will take too long we can start by just adding in the smoke test and follow up with the bmc test later

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Since this got low prio after the MIR was rejected - I think it is fine to continue looking at virtualbmc and eventually proposing this test in Debian.

But this isn't important or urgent to us anymore - and this PR is affected by the same.

Continue on low-prio in Debian on this is you want/need to score Debian-karma or otherwise feel free to drop it entirely right now.

Therefore it isn't really waiting for review and discussion and I wanted to ask to set the MR to WIP or even rejected (as-is) to get it out of our overview.

Revision history for this message
Lena Voytek (lvoytek) wrote :

The dep-8 tests are now ready for review with virtualbmc in universe

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Taking another look

Revision history for this message
Andreas Hasenack (ahasenack) :
Revision history for this message
Andreas Hasenack (ahasenack) :
Revision history for this message
Lena Voytek (lvoytek) :
Revision history for this message
Andreas Hasenack (ahasenack) :
Revision history for this message
Lena Voytek (lvoytek) :
Revision history for this message
Andreas Hasenack (ahasenack) :
Revision history for this message
Andreas Hasenack (ahasenack) :
Revision history for this message
Lena Voytek (lvoytek) :
Revision history for this message
Andreas Hasenack (ahasenack) :
Revision history for this message
Lena Voytek (lvoytek) wrote :

Got rid of the sudo chowns and confirmed the tests still work properly on my end

Revision history for this message
Lena Voytek (lvoytek) wrote :

swapped to isolation-machine for qemuvbmc

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

> swapped to isolation-machine for qemuvbmc

But then nested virtualization needs to work out of the box, does it?

Revision history for this message
Lena Voytek (lvoytek) wrote :

> > swapped to isolation-machine for qemuvbmc
>
> But then nested virtualization needs to work out of the box, does it?

True, not sure what the best way to go about this would be

Revision history for this message
Andreas Hasenack (ahasenack) :
Revision history for this message
Lena Voytek (lvoytek) wrote :

Added needs-root + avoiding xattrs and set test to fail on missing vmlinuz or initrd

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

+1

review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Uploaded:

Uploading ipmitool_1.8.18-11ubuntu3.dsc
Uploading ipmitool_1.8.18-11ubuntu3.debian.tar.xz
Uploading ipmitool_1.8.18-11ubuntu3_source.buildinfo
Uploading ipmitool_1.8.18-11ubuntu3_source.changes

Revision history for this message
git-ubuntu bot (git-ubuntu-bot) wrote :

Approvers: ahasenack, lvoytek
Uploaders: ahasenack
MP auto-approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 22433db..be00840 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,12 @@
6+ipmitool (1.8.18-11ubuntu3) kinetic; urgency=medium
7+
8+ * Add dep8 tests (LP: #1982786)
9+ - d/t/smoke: Add a smoke dep-8 test to confirm ipmitool installs
10+ - d/t/qemuvbmc: Add a qemu + virtualbmc dep-8 test for ipmitool
11+ - d/t/vbmc-qemu-vm-session.xml: define the qemu vm for qemuvbmc
12+
13+ -- Lena Voytek <lena.voytek@canonical.com> Thu, 25 Aug 2022 07:15:09 -0700
14+
15 ipmitool (1.8.18-11ubuntu2) jammy; urgency=medium
16
17 * No-change rebuild against openssl3
18diff --git a/debian/tests/control b/debian/tests/control
19new file mode 100644
20index 0000000..a11e46b
21--- /dev/null
22+++ b/debian/tests/control
23@@ -0,0 +1,16 @@
24+Tests: smoke
25+Depends: ipmitool
26+Restrictions: allow-stderr, superficial
27+
28+Tests: qemuvbmc
29+Depends: ipmitool,
30+ python3-libvirt,
31+ virtualbmc,
32+ bridge-utils,
33+ libvirt-clients,
34+ libvirt-daemon-system,
35+ libxml2-utils,
36+ linux-image-amd64 [amd64] | linux-generic [amd64],
37+ qemu-kvm,
38+ qemu-system,
39+Restrictions: allow-stderr, isolation-container, skippable, skip-not-installable, needs-root
40diff --git a/debian/tests/qemuvbmc b/debian/tests/qemuvbmc
41new file mode 100644
42index 0000000..ccf4012
43--- /dev/null
44+++ b/debian/tests/qemuvbmc
45@@ -0,0 +1,55 @@
46+#!/bin/sh
47+
48+set -e
49+
50+# dep8 qemu + virtualbmc test for ipmitool
51+# Start by defining and creating a qemu vm, then attach vbmc to it.
52+# Afterward test ipmitool commands on the vm.
53+
54+XML=debian/tests/vbmc-qemu-vm-session.xml
55+DOMAIN=bmctest
56+
57+# Clean vm setup on exit
58+cleanup()
59+{
60+ if [ -z "$CLEANED_UP" ]; then
61+ virsh destroy ${DOMAIN} > /dev/null 2>&1 || true
62+ virsh undefine ${DOMAIN} > /dev/null 2>&1 || true
63+ CLEANED_UP=1
64+ fi
65+}
66+
67+trap cleanup EXIT
68+
69+# Confirm kernel and initrd are available for running vm
70+if [ ! -f /boot/vmlinuz ] || [ ! -f /boot/initrd.img ]; then
71+ echo "Kernel or initrd not found...fail".
72+ exit 1
73+fi
74+
75+# Confirm the test is running on amd64
76+if [ $(uname -m) != "x86_64" ]; then
77+ echo "Not on x86_64...skipping"
78+ exit 77
79+fi
80+
81+# We don't want libvirt using xattrs
82+# https://discuss.linuxcontainers.org/t/cant-run-libvirt-qemu-kvm-in-an-unprivileged-domain-anymore-unable-to-set-xattr/9466/3
83+sed -r -i 's,^(#|[[:blank:]])*(remember_owner).*$,\2 = 0,' /etc/libvirt/qemu.conf
84+systemctl restart libvirtd.service
85+
86+# Setup vm
87+virt-xml-validate ${XML}
88+virsh define ${XML}
89+virsh start ${DOMAIN}
90+
91+# Attach virtualbmc to vm
92+vbmc add ${DOMAIN} --port 6230 --username testuser --password pass
93+vbmc start ${DOMAIN}
94+
95+# Test ipmitool
96+ipmitool -I lanplus -U testuser -P pass -H 127.0.0.1 -p 6230 power up
97+ipmitool -I lanplus -U testuser -P pass -H 127.0.0.1 -p 6230 power status
98+ipmitool -I lanplus -U testuser -P pass -H 127.0.0.1 -p 6230 chassis status
99+ipmitool -I lanplus -U testuser -P pass -H 127.0.0.1 -p 6230 power down
100+ipmitool -I lanplus -U testuser -P pass -H 127.0.0.1 -p 6230 power status
101diff --git a/debian/tests/smoke b/debian/tests/smoke
102new file mode 100644
103index 0000000..a2adbb2
104--- /dev/null
105+++ b/debian/tests/smoke
106@@ -0,0 +1,8 @@
107+#!/bin/sh
108+set -ex
109+
110+# dep8 smoke test for ipmitool
111+# Test that the ipmitool binary exists and can get the version and help page
112+
113+ipmitool -h
114+ipmitool -V
115diff --git a/debian/tests/vbmc-qemu-vm-session.xml b/debian/tests/vbmc-qemu-vm-session.xml
116new file mode 100644
117index 0000000..f345b8b
118--- /dev/null
119+++ b/debian/tests/vbmc-qemu-vm-session.xml
120@@ -0,0 +1,32 @@
121+<domain type='qemu'>
122+ <name>bmctest</name>
123+ <memory unit='KiB'>256000</memory>
124+ <currentMemory unit='KiB'>256000</currentMemory>
125+ <vcpu>1</vcpu>
126+ <os>
127+ <type arch='x86_64' machine='pc-i440fx-2.5'>hvm</type>
128+ <kernel>/boot/vmlinuz</kernel>
129+ <initrd>/boot/initrd.img</initrd>
130+ <cmdline> console=ttyS0 quiet loglevel=0 edd=off printk.time=1 noreplace-smp cgroup_disable=memory pci=noearly noapic panic=-1 selinux=0</cmdline>
131+ <boot dev='hd'/>
132+ </os>
133+ <features>
134+ <acpi/>
135+ </features>
136+ <clock offset='utc'/>
137+ <on_poweroff>destroy</on_poweroff>
138+ <on_reboot>destroy</on_reboot>
139+ <on_crash>destroy</on_crash>
140+ <devices>
141+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
142+ <controller type='virtio-serial' index='0'>
143+ <alias name='virtio-serial0'/>
144+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
145+ </controller>
146+ <filesystem type='mount' accessmode='squash'>
147+ <source dir='/'/>
148+ <target dir='bmctest:root'/>
149+ <readonly/>
150+ </filesystem>
151+ </devices>
152+</domain>

Subscribers

People subscribed via source and target branches