* [Qemu-devel] [PULL 28/36] tests: Add ubuntu.i386 image
2017-09-22 7:46 [Qemu-devel] [PULL v5 00/36] Build and test automation patches Fam Zheng
@ 2017-09-22 7:46 ` Fam Zheng
0 siblings, 0 replies; 10+ messages in thread
From: Fam Zheng @ 2017-09-22 7:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell
This adds a 32bit guest.
The official LTS cloud image is downloaded and initialized with
cloud-init.
Signed-off-by: Fam Zheng <famz@redhat.com>
---
tests/vm/ubuntu.i386 | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 89 insertions(+)
create mode 100755 tests/vm/ubuntu.i386
diff --git a/tests/vm/ubuntu.i386 b/tests/vm/ubuntu.i386
new file mode 100755
index 0000000000..fc319e0e6e
--- /dev/null
+++ b/tests/vm/ubuntu.i386
@@ -0,0 +1,89 @@
+#!/usr/bin/env python
+#
+# Ubuntu i386 image
+#
+# Copyright 2017 Red Hat Inc.
+#
+# Authors:
+# Fam Zheng <famz@redhat.com>
+#
+# This code is licensed under the GPL version 2 or later. See
+# the COPYING file in the top-level directory.
+#
+
+import os
+import sys
+import subprocess
+import basevm
+import time
+
+class UbuntuX86VM(basevm.BaseVM):
+ name = "ubuntu.i386"
+ BUILD_SCRIPT = """
+ set -e;
+ cd $(mktemp -d);
+ sudo chmod a+r /dev/vdb;
+ tar -xf /dev/vdb;
+ ./configure {configure_opts};
+ make -j{jobs};
+ make check;
+ """
+
+ def _gen_cloud_init_iso(self):
+ cidir = self._tmpdir
+ mdata = open(os.path.join(cidir, "meta-data"), "w")
+ mdata.writelines(["instance-id: ubuntu-vm-0\n",
+ "local-hostname: ubuntu-guest\n"])
+ mdata.close()
+ udata = open(os.path.join(cidir, "user-data"), "w")
+ udata.writelines(["#cloud-config\n",
+ "chpasswd:\n",
+ " list: |\n",
+ " root:%s\n" % self.ROOT_PASS,
+ " %s:%s\n" % (self.GUEST_USER, self.GUEST_PASS),
+ " expire: False\n",
+ "users:\n",
+ " - name: %s\n" % self.GUEST_USER,
+ " sudo: ALL=(ALL) NOPASSWD:ALL\n",
+ " ssh-authorized-keys:\n",
+ " - %s\n" % basevm.SSH_PUB_KEY,
+ " - name: root\n",
+ " ssh-authorized-keys:\n",
+ " - %s\n" % basevm.SSH_PUB_KEY,
+ "locale: en_US.UTF-8\n"])
+ udata.close()
+ subprocess.check_call(["genisoimage", "-output", "cloud-init.iso",
+ "-volid", "cidata", "-joliet", "-rock",
+ "user-data", "meta-data"],
+ cwd=cidir,
+ stdin=self._devnull, stdout=self._stdout,
+ stderr=self._stdout)
+ return os.path.join(cidir, "cloud-init.iso")
+
+ def build_image(self, img):
+ cimg = self._download_with_cache("https://cloud-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-i386-disk1.img")
+ img_tmp = img + ".tmp"
+ subprocess.check_call(["cp", "-f", cimg, img_tmp])
+ subprocess.check_call(["qemu-img", "resize", img_tmp, "50G"])
+ self.boot(img_tmp, extra_args = ["-cdrom", self._gen_cloud_init_iso()])
+ self.wait_ssh()
+ self.ssh_root_check("touch /etc/cloud/cloud-init.disabled")
+ self.ssh_root_check("apt-get update")
+ self.ssh_root_check("apt-get install -y cloud-initramfs-growroot")
+ # Don't check the status in case the guest hang up too quickly
+ self.ssh_root("sync && reboot")
+ time.sleep(5)
+ self.wait_ssh()
+ # The previous update sometimes doesn't survive a reboot, so do it again
+ self.ssh_root_check("apt-get update")
+ self.ssh_root_check("apt-get build-dep -y qemu")
+ self.ssh_root_check("apt-get install -y libfdt-dev")
+ self.ssh_root("poweroff")
+ self.wait()
+ if os.path.exists(img):
+ os.remove(img)
+ os.rename(img_tmp, img)
+ return 0
+
+if __name__ == "__main__":
+ sys.exit(basevm.main(UbuntuX86VM))
--
2.13.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PULL 28/36] tests: Add ubuntu.i386 image
[not found] <mailman.3351.1506066493.14747.qemu-devel@nongnu.org>
@ 2017-09-22 12:10 ` Programmingkid
2017-09-22 12:44 ` Fam Zheng
0 siblings, 1 reply; 10+ messages in thread
From: Programmingkid @ 2017-09-22 12:10 UTC (permalink / raw)
To: Fam Zheng; +Cc: qemu-devel@nongnu.org qemu-devel
Could a Darwin test be added? Both x86 and PowerPC versions would be great.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL 28/36] tests: Add ubuntu.i386 image
2017-09-22 12:10 ` [Qemu-devel] [PULL 28/36] tests: Add ubuntu.i386 image Programmingkid
@ 2017-09-22 12:44 ` Fam Zheng
2017-09-22 13:18 ` Daniel P. Berrange
2017-09-22 20:22 ` Programmingkid
0 siblings, 2 replies; 10+ messages in thread
From: Fam Zheng @ 2017-09-22 12:44 UTC (permalink / raw)
To: Programmingkid; +Cc: qemu-devel@nongnu.org qemu-devel
On Fri, 09/22 08:10, Programmingkid wrote:
> Could a Darwin test be added? Both x86 and PowerPC versions would be great.
It's nice to cover macOS in our test, but to be honest I don't know how to do
it. If there isn't any copyright problem, and if there are instructions
available in wiki.qemu.org descirbing how to create such a guest step by step
like [1], we can add one.
[1]: https://wiki.qemu.org/Hosts/BSD
Fam
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL 28/36] tests: Add ubuntu.i386 image
2017-09-22 12:44 ` Fam Zheng
@ 2017-09-22 13:18 ` Daniel P. Berrange
2017-09-22 20:26 ` Programmingkid
2017-09-22 20:22 ` Programmingkid
1 sibling, 1 reply; 10+ messages in thread
From: Daniel P. Berrange @ 2017-09-22 13:18 UTC (permalink / raw)
To: Fam Zheng; +Cc: Programmingkid, qemu-devel@nongnu.org qemu-devel
On Fri, Sep 22, 2017 at 08:44:05PM +0800, Fam Zheng wrote:
> On Fri, 09/22 08:10, Programmingkid wrote:
> > Could a Darwin test be added? Both x86 and PowerPC versions would be great.
>
> It's nice to cover macOS in our test, but to be honest I don't know how to do
> it. If there isn't any copyright problem, and if there are instructions
> available in wiki.qemu.org descirbing how to create such a guest step by step
> like [1], we can add one.
AFAICT we can not just provide or host OS-X images and let individual
devs run the without it being a license violation, so best avoided.
IMHO it easier to just rely on Travis' OS-X builders for testing OS-X
platform builds, so that licensing compliance is their responsibility.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL 28/36] tests: Add ubuntu.i386 image
2017-09-22 12:44 ` Fam Zheng
2017-09-22 13:18 ` Daniel P. Berrange
@ 2017-09-22 20:22 ` Programmingkid
2017-09-25 7:31 ` Gerd Hoffmann
1 sibling, 1 reply; 10+ messages in thread
From: Programmingkid @ 2017-09-22 20:22 UTC (permalink / raw)
To: Fam Zheng; +Cc: qemu-devel@nongnu.org qemu-devel
> On Sep 22, 2017, at 8:44 AM, Fam Zheng <famz@redhat.com> wrote:
>
> On Fri, 09/22 08:10, Programmingkid wrote:
>> Could a Darwin test be added? Both x86 and PowerPC versions would be great.
>
> It's nice to cover macOS in our test, but to be honest I don't know how to do
> it. If there isn't any copyright problem, and if there are instructions
> available in wiki.qemu.org descirbing how to create such a guest step by step
> like [1], we can add one.
>
> [1]: https://wiki.qemu.org/Hosts/BSD
>
> Fam
Mac OS X is built on top of Darwin. Darwin is completely open source and free. There are no copyright issues because it is released under the Apple Public Source License.
I think I can make the directions available in the wiki soon.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL 28/36] tests: Add ubuntu.i386 image
2017-09-22 13:18 ` Daniel P. Berrange
@ 2017-09-22 20:26 ` Programmingkid
2017-09-25 8:57 ` Daniel P. Berrange
0 siblings, 1 reply; 10+ messages in thread
From: Programmingkid @ 2017-09-22 20:26 UTC (permalink / raw)
To: Daniel P. Berrange; +Cc: Fam Zheng, qemu-devel@nongnu.org qemu-devel
> On Sep 22, 2017, at 9:18 AM, Daniel P. Berrange <berrange@redhat.com> wrote:
>
> On Fri, Sep 22, 2017 at 08:44:05PM +0800, Fam Zheng wrote:
>> On Fri, 09/22 08:10, Programmingkid wrote:
>>> Could a Darwin test be added? Both x86 and PowerPC versions would be great.
>>
>> It's nice to cover macOS in our test, but to be honest I don't know how to do
>> it. If there isn't any copyright problem, and if there are instructions
>> available in wiki.qemu.org descirbing how to create such a guest step by step
>> like [1], we can add one.
>
> AFAICT we can not just provide or host OS-X images and let individual
> devs run the without it being a license violation, so best avoided.
Actually Darwin and Mac OS X are not the same. Darwin is this minimalistic environment and Mac OS X is built on top of that environment. There would be no license problems when using Darwin only.
> IMHO it easier to just rely on Travis' OS-X builders for testing OS-X
> platform builds, so that licensing compliance is their responsibility.
That might work for the x86 version of Mac OS X, but there doesn't appear to be any support for the PowerPC version of Mac OS X.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL 28/36] tests: Add ubuntu.i386 image
2017-09-22 20:22 ` Programmingkid
@ 2017-09-25 7:31 ` Gerd Hoffmann
2017-09-25 8:51 ` Daniel P. Berrange
0 siblings, 1 reply; 10+ messages in thread
From: Gerd Hoffmann @ 2017-09-25 7:31 UTC (permalink / raw)
To: Programmingkid, Fam Zheng; +Cc: qemu-devel@nongnu.org qemu-devel
Hi,
> Mac OS X is built on top of Darwin. Darwin is completely open source
> and free. There are no copyright issues because it is released under
> the Apple Public Source License.
As far I know cocoa is not open source though.
So, can you actually build qemu on darwin?
And if so, it will probably be GUI-less?
cheers,
Gerd
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL 28/36] tests: Add ubuntu.i386 image
2017-09-25 7:31 ` Gerd Hoffmann
@ 2017-09-25 8:51 ` Daniel P. Berrange
0 siblings, 0 replies; 10+ messages in thread
From: Daniel P. Berrange @ 2017-09-25 8:51 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: Programmingkid, Fam Zheng, qemu-devel@nongnu.org qemu-devel
On Mon, Sep 25, 2017 at 09:31:15AM +0200, Gerd Hoffmann wrote:
> Hi,
>
> > Mac OS X is built on top of Darwin. Darwin is completely open source
> > and free. There are no copyright issues because it is released under
> > the Apple Public Source License.
>
> As far I know cocoa is not open source though.
>
> So, can you actually build qemu on darwin?
> And if so, it will probably be GUI-less?
I guess even a GUI-less build would be beneficial to catch any portability
concerns in the of the code. The majority of people submitting patches to
cocoa GUI will have tested OS-X builds directly themselves. It is all the
patches to non-cocoa code that are greatest risk of regressions and least
likely to have been tested on OS-X by the patch author.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL 28/36] tests: Add ubuntu.i386 image
2017-09-22 20:26 ` Programmingkid
@ 2017-09-25 8:57 ` Daniel P. Berrange
2017-09-25 13:50 ` Programmingkid
0 siblings, 1 reply; 10+ messages in thread
From: Daniel P. Berrange @ 2017-09-25 8:57 UTC (permalink / raw)
To: Programmingkid; +Cc: Fam Zheng, qemu-devel@nongnu.org qemu-devel
On Fri, Sep 22, 2017 at 04:26:40PM -0400, Programmingkid wrote:
>
> > On Sep 22, 2017, at 9:18 AM, Daniel P. Berrange <berrange@redhat.com> wrote:
> >
> > On Fri, Sep 22, 2017 at 08:44:05PM +0800, Fam Zheng wrote:
> >> On Fri, 09/22 08:10, Programmingkid wrote:
> >>> Could a Darwin test be added? Both x86 and PowerPC versions would be great.
> >>
> >> It's nice to cover macOS in our test, but to be honest I don't know how to do
> >> it. If there isn't any copyright problem, and if there are instructions
> >> available in wiki.qemu.org descirbing how to create such a guest step by step
> >> like [1], we can add one.
> >
> > AFAICT we can not just provide or host OS-X images and let individual
> > devs run the without it being a license violation, so best avoided.
>
> Actually Darwin and Mac OS X are not the same. Darwin is this minimalistic
> environment and Mac OS X is built on top of that environment. There would
> be no license problems when using Darwin only.
I looked for images of Darwin but haven't been able to find any modern
ones. Wikipedia claims that Apple stopped releasing installable images
of Darwin so you have to build it from source :-(
> > IMHO it easier to just rely on Travis' OS-X builders for testing OS-X
> > platform builds, so that licensing compliance is their responsibility.
>
> That might work for the x86 version of Mac OS X, but there doesn't appear
> to be any support for the PowerPC version of Mac OS X.
Yeah, no PPC support, but then that's essentially a dead platform, so it
is questionable whether we need to care about OS-X PPC support for QEMU.
The last PPC OS-X hardware shipped 2006.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PULL 28/36] tests: Add ubuntu.i386 image
2017-09-25 8:57 ` Daniel P. Berrange
@ 2017-09-25 13:50 ` Programmingkid
0 siblings, 0 replies; 10+ messages in thread
From: Programmingkid @ 2017-09-25 13:50 UTC (permalink / raw)
To: Daniel P. Berrange; +Cc: Fam Zheng, qemu-devel@nongnu.org qemu-devel
> On Sep 25, 2017, at 4:57 AM, Daniel P. Berrange <berrange@redhat.com> wrote:
>
> On Fri, Sep 22, 2017 at 04:26:40PM -0400, Programmingkid wrote:
>>
>>> On Sep 22, 2017, at 9:18 AM, Daniel P. Berrange <berrange@redhat.com> wrote:
>>>
>>> On Fri, Sep 22, 2017 at 08:44:05PM +0800, Fam Zheng wrote:
>>>> On Fri, 09/22 08:10, Programmingkid wrote:
>>>>> Could a Darwin test be added? Both x86 and PowerPC versions would be great.
>>>>
>>>> It's nice to cover macOS in our test, but to be honest I don't know how to do
>>>> it. If there isn't any copyright problem, and if there are instructions
>>>> available in wiki.qemu.org descirbing how to create such a guest step by step
>>>> like [1], we can add one.
>>>
>>> AFAICT we can not just provide or host OS-X images and let individual
>>> devs run the without it being a license violation, so best avoided.
>>
>> Actually Darwin and Mac OS X are not the same. Darwin is this minimalistic
>> environment and Mac OS X is built on top of that environment. There would
>> be no license problems when using Darwin only.
>
> I looked for images of Darwin but haven't been able to find any modern
> ones. Wikipedia claims that Apple stopped releasing installable images
> of Darwin so you have to build it from source :-(
I did find this project: http://www.puredarwin.org, but they haven't released an image file yet.
>
>>> IMHO it easier to just rely on Travis' OS-X builders for testing OS-X
>>> platform builds, so that licensing compliance is their responsibility.
>>
>> That might work for the x86 version of Mac OS X, but there doesn't appear
>> to be any support for the PowerPC version of Mac OS X.
>
> Yeah, no PPC support, but then that's essentially a dead platform, so it
> is questionable whether we need to care about OS-X PPC support for QEMU.
> The last PPC OS-X hardware shipped 2006.
Good point.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2017-09-25 13:50 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.3351.1506066493.14747.qemu-devel@nongnu.org>
2017-09-22 12:10 ` [Qemu-devel] [PULL 28/36] tests: Add ubuntu.i386 image Programmingkid
2017-09-22 12:44 ` Fam Zheng
2017-09-22 13:18 ` Daniel P. Berrange
2017-09-22 20:26 ` Programmingkid
2017-09-25 8:57 ` Daniel P. Berrange
2017-09-25 13:50 ` Programmingkid
2017-09-22 20:22 ` Programmingkid
2017-09-25 7:31 ` Gerd Hoffmann
2017-09-25 8:51 ` Daniel P. Berrange
2017-09-22 7:46 [Qemu-devel] [PULL v5 00/36] Build and test automation patches Fam Zheng
2017-09-22 7:46 ` [Qemu-devel] [PULL 28/36] tests: Add ubuntu.i386 image Fam Zheng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).