From pierre-alain.toret at protonmail.com Thu Oct 5 07:32:05 2017 From: pierre-alain.toret at protonmail.com (Pierre-Alain TORET) Date: Thu, 5 Oct 2017 09:32:05 +0200 Subject: [Libosinfo] [PATCH osinfo-db] freebsd: Fix 11.1 i386-dvd1 iso url Message-ID: <20171005073205.9444-1-pierre-alain.toret@protonmail.com> Hello, this is my first try at sending a patch. I'm starting with a small change. Best regards, --- data/os/freebsd.org/freebsd-11.1.xml.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/os/freebsd.org/freebsd-11.1.xml.in b/data/os/freebsd.org/freebsd-11.1.xml.in index 74d8a20..837a285 100644 --- a/data/os/freebsd.org/freebsd-11.1.xml.in +++ b/data/os/freebsd.org/freebsd-11.1.xml.in @@ -33,7 +33,7 @@ - https://download.freebsd.org/ftp/releases/ISO-IMAGES/11.0/FreeBSD-11.0-RELEASE-i386-dvd1.iso + https://download.freebsd.org/ftp/releases/ISO-IMAGES/11.1/FreeBSD-11.1-RELEASE-i386-dvd1.iso FreeBSD 11_1_RELEASE_I386_DVD -- 2.14.2 From berrange at redhat.com Thu Oct 5 09:16:32 2017 From: berrange at redhat.com (Daniel P. Berrange) Date: Thu, 5 Oct 2017 10:16:32 +0100 Subject: [Libosinfo] [PATCH osinfo-db] freebsd: Fix 11.1 i386-dvd1 iso url In-Reply-To: <20171005073205.9444-1-pierre-alain.toret@protonmail.com> References: <20171005073205.9444-1-pierre-alain.toret@protonmail.com> Message-ID: <20171005091632.GD12106@redhat.com> On Thu, Oct 05, 2017 at 09:32:05AM +0200, Pierre-Alain TORET wrote: > Hello, > > this is my first try at sending a patch. I'm starting with a small change. > > Best regards, > --- > data/os/freebsd.org/freebsd-11.1.xml.in | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/data/os/freebsd.org/freebsd-11.1.xml.in b/data/os/freebsd.org/freebsd-11.1.xml.in > index 74d8a20..837a285 100644 > --- a/data/os/freebsd.org/freebsd-11.1.xml.in > +++ b/data/os/freebsd.org/freebsd-11.1.xml.in > @@ -33,7 +33,7 @@ > > > > - https://download.freebsd.org/ftp/releases/ISO-IMAGES/11.0/FreeBSD-11.0-RELEASE-i386-dvd1.iso > + https://download.freebsd.org/ftp/releases/ISO-IMAGES/11.1/FreeBSD-11.1-RELEASE-i386-dvd1.iso > > FreeBSD > 11_1_RELEASE_I386_DVD ACK, and pushed to git. FWIW, we encourage people to use 'git send-email' to format + send patches, or at least use 'git format-patch' to crete the patch so that it records your authorship details in the patch. 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 :| From bogorodskiy at gmail.com Thu Oct 5 10:38:41 2017 From: bogorodskiy at gmail.com (Roman Bogorodskiy) Date: Thu, 5 Oct 2017 14:38:41 +0400 Subject: [Libosinfo] [PATCH osinfo-db] freebsd: add FreeBSD 10.4 info Message-ID: <20171005103841.26129-1-bogorodskiy@gmail.com> --- data/os/freebsd.org/freebsd-10.4.xml.in | 51 +++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 data/os/freebsd.org/freebsd-10.4.xml.in diff --git a/data/os/freebsd.org/freebsd-10.4.xml.in b/data/os/freebsd.org/freebsd-10.4.xml.in new file mode 100644 index 0000000..5697b69 --- /dev/null +++ b/data/os/freebsd.org/freebsd-10.4.xml.in @@ -0,0 +1,51 @@ + + + + freebsd10.4 + <_name>FreeBSD 10.4 + 10.4 + <_vendor>FreeBSD Project + freebsd + freebsd + + + + 2017-10-04 + 2018-10-31 + + + + + + + + https://download.freebsd.org/ftp/releases/ISO-IMAGES/10.4/FreeBSD-10.4-RELEASE-amd64-dvd1.iso + + FreeBSD + 10_4_RELEASE_AMD64_DVD + + + + https://download.freebsd.org/ftp/releases/ISO-IMAGES/10.4/FreeBSD-10.4-RELEASE-amd64-disc1.iso + + FreeBSD + 10_4_RELEASE_AMD64_CD + + + + https://download.freebsd.org/ftp/releases/ISO-IMAGES/10.4/FreeBSD-10.4-RELEASE-i386-dvd1.iso + + FreeBSD + 10_4_RELEASE_I386_DVD + + + + https://download.freebsd.org/ftp/releases/ISO-IMAGES/10.4/FreeBSD-10.4-RELEASE-i386-disc1.iso + + FreeBSD + 10_4_RELEASE_I386_CD + + + + -- 2.14.1 From bogorodskiy at gmail.com Thu Oct 5 10:40:43 2017 From: bogorodskiy at gmail.com (Roman Bogorodskiy) Date: Thu, 5 Oct 2017 14:40:43 +0400 Subject: [Libosinfo] [PATCH libosinfo] freebsd: Add FreeBSD 10.4 isodata Message-ID: <20171005104043.26327-1-bogorodskiy@gmail.com> --- .../FreeBSD-10.4-RELEASE-amd64-disc1.iso.txt | 33 ++++++++++++++++++++++ .../FreeBSD-10.4-RELEASE-amd64-dvd1.iso.txt | 33 ++++++++++++++++++++++ .../FreeBSD-10.4-RELEASE-i386-disc1.iso.txt | 33 ++++++++++++++++++++++ .../FreeBSD-10.4-RELEASE-i386-dvd1.iso.txt | 33 ++++++++++++++++++++++ 4 files changed, 132 insertions(+) create mode 100644 tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-amd64-disc1.iso.txt create mode 100644 tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-amd64-dvd1.iso.txt create mode 100644 tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-i386-disc1.iso.txt create mode 100644 tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-i386-dvd1.iso.txt diff --git a/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-amd64-disc1.iso.txt b/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-amd64-disc1.iso.txt new file mode 100644 index 0000000..c0ae09d --- /dev/null +++ b/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-amd64-disc1.iso.txt @@ -0,0 +1,33 @@ +CD-ROM is in ISO 9660 format +System id: FreeBSD +Volume id: 10_4_RELEASE_AMD64_CD +Volume set id: +Publisher id: THE FREEBSD PROJECT. HTTP://WWW.FREEBSD.ORG/ +Data preparer id: +Application id: +Copyright File id: +Abstract File id: +Bibliographic File id: +Volume set size is: 1 +Volume set sequence number is: 1 +Logical block size is: 2048 +Volume size is: 313305 +El Torito VD version 1 found, boot catalog is in sector 19 +NO Joliet present + +SUSP signatures version 1 found +Rock Ridge signatures version 1 found +Rock Ridge id 'IEEE_P1282' +Eltorito validation header: + Hid 1 + Arch 0 (x86) + ID '' + Cksum AA 55 OK + Key 55 AA + Eltorito defaultboot header: + Bootid 88 (bootable) + Boot media 0 (No Emulation Boot) + Load segment 0 + Sys type 0 + Nsect 4 + Bootoff 14 20 diff --git a/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-amd64-dvd1.iso.txt b/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-amd64-dvd1.iso.txt new file mode 100644 index 0000000..e7c27a3 --- /dev/null +++ b/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-amd64-dvd1.iso.txt @@ -0,0 +1,33 @@ +CD-ROM is in ISO 9660 format +System id: FreeBSD +Volume id: 10_4_RELEASE_AMD64_DVD +Volume set id: +Publisher id: THE FREEBSD PROJECT. HTTP://WWW.FREEBSD.ORG/ +Data preparer id: +Application id: +Copyright File id: +Abstract File id: +Bibliographic File id: +Volume set size is: 1 +Volume set sequence number is: 1 +Logical block size is: 2048 +Volume size is: 1484567 +El Torito VD version 1 found, boot catalog is in sector 19 +NO Joliet present + +SUSP signatures version 1 found +Rock Ridge signatures version 1 found +Rock Ridge id 'IEEE_P1282' +Eltorito validation header: + Hid 1 + Arch 0 (x86) + ID '' + Cksum AA 55 OK + Key 55 AA + Eltorito defaultboot header: + Bootid 88 (bootable) + Boot media 0 (No Emulation Boot) + Load segment 0 + Sys type 0 + Nsect 4 + Bootoff 14 20 diff --git a/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-i386-disc1.iso.txt b/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-i386-disc1.iso.txt new file mode 100644 index 0000000..a582b20 --- /dev/null +++ b/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-i386-disc1.iso.txt @@ -0,0 +1,33 @@ +CD-ROM is in ISO 9660 format +System id: FreeBSD +Volume id: 10_4_RELEASE_I386_CD +Volume set id: +Publisher id: THE FREEBSD PROJECT. HTTP://WWW.FREEBSD.ORG/ +Data preparer id: +Application id: +Copyright File id: +Abstract File id: +Bibliographic File id: +Volume set size is: 1 +Volume set sequence number is: 1 +Logical block size is: 2048 +Volume size is: 277985 +El Torito VD version 1 found, boot catalog is in sector 19 +NO Joliet present + +SUSP signatures version 1 found +Rock Ridge signatures version 1 found +Rock Ridge id 'IEEE_P1282' +Eltorito validation header: + Hid 1 + Arch 0 (x86) + ID '' + Cksum AA 55 OK + Key 55 AA + Eltorito defaultboot header: + Bootid 88 (bootable) + Boot media 0 (No Emulation Boot) + Load segment 0 + Sys type 0 + Nsect 4 + Bootoff 14 20 diff --git a/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-i386-dvd1.iso.txt b/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-i386-dvd1.iso.txt new file mode 100644 index 0000000..8e913b4 --- /dev/null +++ b/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-i386-dvd1.iso.txt @@ -0,0 +1,33 @@ +CD-ROM is in ISO 9660 format +System id: FreeBSD +Volume id: 10_4_RELEASE_I386_DVD +Volume set id: +Publisher id: THE FREEBSD PROJECT. HTTP://WWW.FREEBSD.ORG/ +Data preparer id: +Application id: +Copyright File id: +Abstract File id: +Bibliographic File id: +Volume set size is: 1 +Volume set sequence number is: 1 +Logical block size is: 2048 +Volume size is: 1373155 +El Torito VD version 1 found, boot catalog is in sector 19 +NO Joliet present + +SUSP signatures version 1 found +Rock Ridge signatures version 1 found +Rock Ridge id 'IEEE_P1282' +Eltorito validation header: + Hid 1 + Arch 0 (x86) + ID '' + Cksum AA 55 OK + Key 55 AA + Eltorito defaultboot header: + Bootid 88 (bootable) + Boot media 0 (No Emulation Boot) + Load segment 0 + Sys type 0 + Nsect 4 + Bootoff 14 20 -- 2.14.1 From pierre-alain.toret at protonmail.com Thu Oct 5 15:45:03 2017 From: pierre-alain.toret at protonmail.com (Pierre-Alain TORET) Date: Thu, 5 Oct 2017 17:45:03 +0200 Subject: [Libosinfo] [PATCH osinfo-db] openbsd: add OpenBSD 5.9 info Message-ID: <20171005154503.26775-1-pierre-alain.toret@protonmail.com> Signed-off-by: Pierre-Alain TORET --- data/os/openbsd.org/openbsd-5.9.xml.in | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 data/os/openbsd.org/openbsd-5.9.xml.in diff --git a/data/os/openbsd.org/openbsd-5.9.xml.in b/data/os/openbsd.org/openbsd-5.9.xml.in new file mode 100644 index 0000000..8a66aed --- /dev/null +++ b/data/os/openbsd.org/openbsd-5.9.xml.in @@ -0,0 +1,35 @@ + + + + openbsd5.9 + <_name>OpenBSD 5.9 + 5.9 + openbsd + openbsd + <_vendor>OpenBSD Project + + + 2016-03-29 + + + https://fastly.cdn.openbsd.org/pub/OpenBSD/5.9/i386/install59.iso + + The OpenBSD project + OpenBSD + OpenBSD/i386 5.9 Install CD + OpenBSD 5.9 i386 Install CD + + + + + https://fastly.cdn.openbsd.org/pub/OpenBSD/5.9/amd64/install59.iso + + The OpenBSD project + OpenBSD + OpenBSD/amd64 5.9 Install CD + OpenBSD 5.9 amd64 Install CD + + + + -- 2.14.2 From pierre-alain.toret at protonmail.com Thu Oct 5 15:45:42 2017 From: pierre-alain.toret at protonmail.com (Pierre-Alain TORET) Date: Thu, 5 Oct 2017 17:45:42 +0200 Subject: [Libosinfo] [PATCH libosinfo] openbsd: add OpenBSD 5.9 isodata Message-ID: <20171005154542.26852-1-pierre-alain.toret@protonmail.com> Signed-off-by: Pierre-Alain TORET --- .../openbsd/openbsd5.9/openbsd-5.9-amd64.txt | 33 ++++++++++++++++++++++ .../openbsd/openbsd5.9/openbsd-5.9-i386.txt | 33 ++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 tests/isodata/openbsd/openbsd5.9/openbsd-5.9-amd64.txt create mode 100644 tests/isodata/openbsd/openbsd5.9/openbsd-5.9-i386.txt diff --git a/tests/isodata/openbsd/openbsd5.9/openbsd-5.9-amd64.txt b/tests/isodata/openbsd/openbsd5.9/openbsd-5.9-amd64.txt new file mode 100644 index 0000000..5070cad --- /dev/null +++ b/tests/isodata/openbsd/openbsd5.9/openbsd-5.9-amd64.txt @@ -0,0 +1,33 @@ +CD-ROM is in ISO 9660 format +System id: OpenBSD +Volume id: OpenBSD/amd64 5.9 Install CD +Volume set id: +Publisher id: Copyright (c) 2016 Theo de Raadt, The OpenBSD project +Data preparer id: Theo de Raadt +Application id: OpenBSD 5.9 amd64 Install CD +Copyright File id: +Abstract File id: +Bibliographic File id: +Volume set size is: 1 +Volume set sequence number is: 1 +Logical block size is: 2048 +Volume size is: 114093 +El Torito VD version 1 found, boot catalog is in sector 25835 +NO Joliet present + +SUSP signatures version 1 found +Rock Ridge signatures version 1 found +Rock Ridge id 'RRIP_1991A' +Eltorito validation header: + Hid 1 + Arch 0 (x86) + ID 'Copyright (c) 2016 Theo' + Cksum FF D6 OK + Key 55 AA + Eltorito defaultboot header: + Bootid 88 (bootable) + Boot media 0 (No Emulation Boot) + Load segment 0 + Sys type 0 + Nsect 4 + Bootoff 9B0B 39691 diff --git a/tests/isodata/openbsd/openbsd5.9/openbsd-5.9-i386.txt b/tests/isodata/openbsd/openbsd5.9/openbsd-5.9-i386.txt new file mode 100644 index 0000000..0b7fae9 --- /dev/null +++ b/tests/isodata/openbsd/openbsd5.9/openbsd-5.9-i386.txt @@ -0,0 +1,33 @@ +CD-ROM is in ISO 9660 format +System id: OpenBSD +Volume id: OpenBSD/i386 5.9 Install CD +Volume set id: +Publisher id: Copyright (c) 2016 Theo de Raadt, The OpenBSD project +Data preparer id: Theo de Raadt +Application id: OpenBSD 5.9 i386 Install CD +Copyright File id: +Abstract File id: +Bibliographic File id: +Volume set size is: 1 +Volume set sequence number is: 1 +Logical block size is: 2048 +Volume size is: 108955 +El Torito VD version 1 found, boot catalog is in sector 24333 +NO Joliet present + +SUSP signatures version 1 found +Rock Ridge signatures version 1 found +Rock Ridge id 'RRIP_1991A' +Eltorito validation header: + Hid 1 + Arch 0 (x86) + ID 'Copyright (c) 2016 Theo' + Cksum FF D6 OK + Key 55 AA + Eltorito defaultboot header: + Bootid 88 (bootable) + Boot media 0 (No Emulation Boot) + Load segment 0 + Sys type 0 + Nsect 4 + Bootoff 95D4 38356 -- 2.14.2 From pierre-alain.toret at protonmail.com Tue Oct 10 15:39:40 2017 From: pierre-alain.toret at protonmail.com (Pierre-Alain TORET) Date: Tue, 10 Oct 2017 17:39:40 +0200 Subject: [Libosinfo] [PATCH osinfo-db 0/3] openbsd: add OpenBSD 6.0 6.1 6.2 info Message-ID: <20171010153943.31305-1-pierre-alain.toret@protonmail.com> Pierre-Alain TORET (3): openbsd: add OpenBSD 6.0 info openbsd: add OpenBSD 6.1 info openbsd: add OpenBSD 6.2 info data/os/openbsd.org/openbsd-6.0.xml.in | 35 ++++++++++++++++++++++++++++++++++ data/os/openbsd.org/openbsd-6.1.xml.in | 35 ++++++++++++++++++++++++++++++++++ data/os/openbsd.org/openbsd-6.2.xml.in | 35 ++++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 data/os/openbsd.org/openbsd-6.0.xml.in create mode 100644 data/os/openbsd.org/openbsd-6.1.xml.in create mode 100644 data/os/openbsd.org/openbsd-6.2.xml.in -- 2.14.2 From pierre-alain.toret at protonmail.com Tue Oct 10 15:39:41 2017 From: pierre-alain.toret at protonmail.com (Pierre-Alain TORET) Date: Tue, 10 Oct 2017 17:39:41 +0200 Subject: [Libosinfo] [PATCH osinfo-db 1/3] openbsd: add OpenBSD 6.0 info In-Reply-To: <20171010153943.31305-1-pierre-alain.toret@protonmail.com> References: <20171010153943.31305-1-pierre-alain.toret@protonmail.com> Message-ID: <20171010153943.31305-2-pierre-alain.toret@protonmail.com> Signed-off-by: Pierre-Alain TORET --- data/os/openbsd.org/openbsd-6.0.xml.in | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 data/os/openbsd.org/openbsd-6.0.xml.in diff --git a/data/os/openbsd.org/openbsd-6.0.xml.in b/data/os/openbsd.org/openbsd-6.0.xml.in new file mode 100644 index 0000000..244be03 --- /dev/null +++ b/data/os/openbsd.org/openbsd-6.0.xml.in @@ -0,0 +1,35 @@ + + + + openbsd6.0 + <_name>OpenBSD 6.0 + 6.0 + openbsd + openbsd + <_vendor>OpenBSD Project + + + 2016-09-01 + + + https://fastly.cdn.openbsd.org/pub/OpenBSD/6.0/i386/install60.iso + + The OpenBSD project + OpenBSD + OpenBSD/i386 6.0 Install CD + OpenBSD 6.0 i386 Install CD + + + + + https://fastly.cdn.openbsd.org/pub/OpenBSD/6.0/amd64/install60.iso + + The OpenBSD project + OpenBSD + OpenBSD/amd64 6.0 Install CD + OpenBSD 6.0 amd64 Install CD + + + + -- 2.14.2 From pierre-alain.toret at protonmail.com Tue Oct 10 15:39:42 2017 From: pierre-alain.toret at protonmail.com (Pierre-Alain TORET) Date: Tue, 10 Oct 2017 17:39:42 +0200 Subject: [Libosinfo] [PATCH osinfo-db 2/3] openbsd: add OpenBSD 6.1 info In-Reply-To: <20171010153943.31305-1-pierre-alain.toret@protonmail.com> References: <20171010153943.31305-1-pierre-alain.toret@protonmail.com> Message-ID: <20171010153943.31305-3-pierre-alain.toret@protonmail.com> Signed-off-by: Pierre-Alain TORET --- data/os/openbsd.org/openbsd-6.1.xml.in | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 data/os/openbsd.org/openbsd-6.1.xml.in diff --git a/data/os/openbsd.org/openbsd-6.1.xml.in b/data/os/openbsd.org/openbsd-6.1.xml.in new file mode 100644 index 0000000..0add743 --- /dev/null +++ b/data/os/openbsd.org/openbsd-6.1.xml.in @@ -0,0 +1,35 @@ + + + + openbsd6.1 + <_name>OpenBSD 6.1 + 6.1 + openbsd + openbsd + <_vendor>OpenBSD Project + + + 2017-04-11 + + + https://fastly.cdn.openbsd.org/pub/OpenBSD/6.1/i386/install61.iso + + The OpenBSD project + OpenBSD + OpenBSD/i386 6.1 Install CD + OpenBSD 6.1 i386 Install CD + + + + + https://fastly.cdn.openbsd.org/pub/OpenBSD/6.1/amd64/install61.iso + + The OpenBSD project + OpenBSD + OpenBSD/amd64 6.1 Install CD + OpenBSD 6.1 amd64 Install CD + + + + -- 2.14.2 From pierre-alain.toret at protonmail.com Tue Oct 10 15:39:43 2017 From: pierre-alain.toret at protonmail.com (Pierre-Alain TORET) Date: Tue, 10 Oct 2017 17:39:43 +0200 Subject: [Libosinfo] [PATCH osinfo-db 3/3] openbsd: add OpenBSD 6.2 info In-Reply-To: <20171010153943.31305-1-pierre-alain.toret@protonmail.com> References: <20171010153943.31305-1-pierre-alain.toret@protonmail.com> Message-ID: <20171010153943.31305-4-pierre-alain.toret@protonmail.com> Signed-off-by: Pierre-Alain TORET --- data/os/openbsd.org/openbsd-6.2.xml.in | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 data/os/openbsd.org/openbsd-6.2.xml.in diff --git a/data/os/openbsd.org/openbsd-6.2.xml.in b/data/os/openbsd.org/openbsd-6.2.xml.in new file mode 100644 index 0000000..08e5789 --- /dev/null +++ b/data/os/openbsd.org/openbsd-6.2.xml.in @@ -0,0 +1,35 @@ + + + + openbsd6.2 + <_name>OpenBSD 6.2 + 6.2 + openbsd + openbsd + <_vendor>OpenBSD Project + + + 2017-10-09 + + + https://fastly.cdn.openbsd.org/pub/OpenBSD/6.2/i386/install62.iso + + The OpenBSD project + OpenBSD + OpenBSD/i386 6.2 Install CD + OpenBSD 6.2 i386 Install CD + + + + + https://fastly.cdn.openbsd.org/pub/OpenBSD/6.2/amd64/install62.iso + + The OpenBSD project + OpenBSD + OpenBSD/amd64 6.2 Install CD + OpenBSD 6.2 amd64 Install CD + + + + -- 2.14.2 From pierre-alain.toret at protonmail.com Tue Oct 10 15:41:53 2017 From: pierre-alain.toret at protonmail.com (Pierre-Alain TORET) Date: Tue, 10 Oct 2017 17:41:53 +0200 Subject: [Libosinfo] [PATCH libosinfo 0/3] openbsd: add OpenBSD 6.0 6.1 6.2 isodata Message-ID: <20171010154156.31440-1-pierre-alain.toret@protonmail.com> Pierre-Alain TORET (3): openbsd: add OpenBSD 6.0 isodata openbsd: add OpenBSD 6.1 isodata openbsd: add OpenBSD 6.2 isodata .../openbsd/openbsd6.0/openbsd-6.0-amd64.txt | 33 ++++++++++++++++++++++ .../openbsd/openbsd6.0/openbsd-6.0-i386.txt | 33 ++++++++++++++++++++++ .../openbsd/openbsd6.1/openbsd-6.1-amd64.txt | 33 ++++++++++++++++++++++ .../openbsd/openbsd6.1/openbsd-6.1-i386.txt | 33 ++++++++++++++++++++++ .../openbsd/openbsd6.2/openbsd-6.2-amd64.txt | 33 ++++++++++++++++++++++ .../openbsd/openbsd6.2/openbsd-6.2-i386.txt | 33 ++++++++++++++++++++++ 6 files changed, 198 insertions(+) create mode 100644 tests/isodata/openbsd/openbsd6.0/openbsd-6.0-amd64.txt create mode 100644 tests/isodata/openbsd/openbsd6.0/openbsd-6.0-i386.txt create mode 100644 tests/isodata/openbsd/openbsd6.1/openbsd-6.1-amd64.txt create mode 100644 tests/isodata/openbsd/openbsd6.1/openbsd-6.1-i386.txt create mode 100644 tests/isodata/openbsd/openbsd6.2/openbsd-6.2-amd64.txt create mode 100644 tests/isodata/openbsd/openbsd6.2/openbsd-6.2-i386.txt -- 2.14.2 From pierre-alain.toret at protonmail.com Tue Oct 10 15:41:54 2017 From: pierre-alain.toret at protonmail.com (Pierre-Alain TORET) Date: Tue, 10 Oct 2017 17:41:54 +0200 Subject: [Libosinfo] [PATCH libosinfo 1/3] openbsd: add OpenBSD 6.0 isodata In-Reply-To: <20171010154156.31440-1-pierre-alain.toret@protonmail.com> References: <20171010154156.31440-1-pierre-alain.toret@protonmail.com> Message-ID: <20171010154156.31440-2-pierre-alain.toret@protonmail.com> Signed-off-by: Pierre-Alain TORET --- .../openbsd/openbsd6.0/openbsd-6.0-amd64.txt | 33 ++++++++++++++++++++++ .../openbsd/openbsd6.0/openbsd-6.0-i386.txt | 33 ++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 tests/isodata/openbsd/openbsd6.0/openbsd-6.0-amd64.txt create mode 100644 tests/isodata/openbsd/openbsd6.0/openbsd-6.0-i386.txt diff --git a/tests/isodata/openbsd/openbsd6.0/openbsd-6.0-amd64.txt b/tests/isodata/openbsd/openbsd6.0/openbsd-6.0-amd64.txt new file mode 100644 index 0000000..133742d --- /dev/null +++ b/tests/isodata/openbsd/openbsd6.0/openbsd-6.0-amd64.txt @@ -0,0 +1,33 @@ +CD-ROM is in ISO 9660 format +System id: OpenBSD +Volume id: OpenBSD/amd64 6.0 Install CD +Volume set id: +Publisher id: Copyright (c) 2016 Theo de Raadt, The OpenBSD project +Data preparer id: Theo de Raadt +Application id: OpenBSD 6.0 amd64 Install CD +Copyright File id: +Abstract File id: +Bibliographic File id: +Volume set size is: 1 +Volume set sequence number is: 1 +Logical block size is: 2048 +Volume size is: 115951 +El Torito VD version 1 found, boot catalog is in sector 27243 +NO Joliet present + +SUSP signatures version 1 found +Rock Ridge signatures version 1 found +Rock Ridge id 'RRIP_1991A' +Eltorito validation header: + Hid 1 + Arch 0 (x86) + ID 'Copyright (c) 2016 Theo' + Cksum FF D6 OK + Key 55 AA + Eltorito defaultboot header: + Bootid 88 (bootable) + Boot media 0 (No Emulation Boot) + Load segment 0 + Sys type 0 + Nsect 4 + Bootoff A1D1 41425 diff --git a/tests/isodata/openbsd/openbsd6.0/openbsd-6.0-i386.txt b/tests/isodata/openbsd/openbsd6.0/openbsd-6.0-i386.txt new file mode 100644 index 0000000..1f3e174 --- /dev/null +++ b/tests/isodata/openbsd/openbsd6.0/openbsd-6.0-i386.txt @@ -0,0 +1,33 @@ +CD-ROM is in ISO 9660 format +System id: OpenBSD +Volume id: OpenBSD/i386 6.0 Install CD +Volume set id: +Publisher id: Copyright (c) 2016 Theo de Raadt, The OpenBSD project +Data preparer id: Theo de Raadt +Application id: OpenBSD 6.0 i386 Install CD +Copyright File id: +Abstract File id: +Bibliographic File id: +Volume set size is: 1 +Volume set sequence number is: 1 +Logical block size is: 2048 +Volume size is: 110500 +El Torito VD version 1 found, boot catalog is in sector 25588 +NO Joliet present + +SUSP signatures version 1 found +Rock Ridge signatures version 1 found +Rock Ridge id 'RRIP_1991A' +Eltorito validation header: + Hid 1 + Arch 0 (x86) + ID 'Copyright (c) 2016 Theo' + Cksum FF D6 OK + Key 55 AA + Eltorito defaultboot header: + Bootid 88 (bootable) + Boot media 0 (No Emulation Boot) + Load segment 0 + Sys type 0 + Nsect 4 + Bootoff 9B5B 39771 -- 2.14.2 From pierre-alain.toret at protonmail.com Tue Oct 10 15:41:55 2017 From: pierre-alain.toret at protonmail.com (Pierre-Alain TORET) Date: Tue, 10 Oct 2017 17:41:55 +0200 Subject: [Libosinfo] [PATCH libosinfo 2/3] openbsd: add OpenBSD 6.1 isodata In-Reply-To: <20171010154156.31440-1-pierre-alain.toret@protonmail.com> References: <20171010154156.31440-1-pierre-alain.toret@protonmail.com> Message-ID: <20171010154156.31440-3-pierre-alain.toret@protonmail.com> Signed-off-by: Pierre-Alain TORET --- .../openbsd/openbsd6.1/openbsd-6.1-amd64.txt | 33 ++++++++++++++++++++++ .../openbsd/openbsd6.1/openbsd-6.1-i386.txt | 33 ++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 tests/isodata/openbsd/openbsd6.1/openbsd-6.1-amd64.txt create mode 100644 tests/isodata/openbsd/openbsd6.1/openbsd-6.1-i386.txt diff --git a/tests/isodata/openbsd/openbsd6.1/openbsd-6.1-amd64.txt b/tests/isodata/openbsd/openbsd6.1/openbsd-6.1-amd64.txt new file mode 100644 index 0000000..786c606 --- /dev/null +++ b/tests/isodata/openbsd/openbsd6.1/openbsd-6.1-amd64.txt @@ -0,0 +1,33 @@ +CD-ROM is in ISO 9660 format +System id: OpenBSD +Volume id: OpenBSD/amd64 6.1 Install CD +Volume set id: +Publisher id: Copyright (c) 2017 Theo de Raadt, The OpenBSD project +Data preparer id: Theo de Raadt +Application id: OpenBSD 6.1 amd64 Install CD +Copyright File id: +Abstract File id: +Bibliographic File id: +Volume set size is: 1 +Volume set sequence number is: 1 +Logical block size is: 2048 +Volume size is: 107214 +El Torito VD version 1 found, boot catalog is in sector 26193 +NO Joliet present + +SUSP signatures version 1 found +Rock Ridge signatures version 1 found +Rock Ridge id 'RRIP_1991A' +Eltorito validation header: + Hid 1 + Arch 0 (x86) + ID 'Copyright (c) 2017 Theo' + Cksum FF D5 OK + Key 55 AA + Eltorito defaultboot header: + Bootid 88 (bootable) + Boot media 0 (No Emulation Boot) + Load segment 0 + Sys type 0 + Nsect 4 + Bootoff A15F 41311 diff --git a/tests/isodata/openbsd/openbsd6.1/openbsd-6.1-i386.txt b/tests/isodata/openbsd/openbsd6.1/openbsd-6.1-i386.txt new file mode 100644 index 0000000..650b8af --- /dev/null +++ b/tests/isodata/openbsd/openbsd6.1/openbsd-6.1-i386.txt @@ -0,0 +1,33 @@ +CD-ROM is in ISO 9660 format +System id: OpenBSD +Volume id: OpenBSD/i386 6.1 Install CD +Volume set id: +Publisher id: Copyright (c) 2017 Theo de Raadt, The OpenBSD project +Data preparer id: Theo de Raadt +Application id: OpenBSD 6.1 i386 Install CD +Copyright File id: +Abstract File id: +Bibliographic File id: +Volume set size is: 1 +Volume set sequence number is: 1 +Logical block size is: 2048 +Volume size is: 101903 +El Torito VD version 1 found, boot catalog is in sector 24562 +NO Joliet present + +SUSP signatures version 1 found +Rock Ridge signatures version 1 found +Rock Ridge id 'RRIP_1991A' +Eltorito validation header: + Hid 1 + Arch 0 (x86) + ID 'Copyright (c) 2017 Theo' + Cksum FF D5 OK + Key 55 AA + Eltorito defaultboot header: + Bootid 88 (bootable) + Boot media 0 (No Emulation Boot) + Load segment 0 + Sys type 0 + Nsect 4 + Bootoff 9A06 39430 -- 2.14.2 From pierre-alain.toret at protonmail.com Tue Oct 10 15:41:56 2017 From: pierre-alain.toret at protonmail.com (Pierre-Alain TORET) Date: Tue, 10 Oct 2017 17:41:56 +0200 Subject: [Libosinfo] [PATCH libosinfo 3/3] openbsd: add OpenBSD 6.2 isodata In-Reply-To: <20171010154156.31440-1-pierre-alain.toret@protonmail.com> References: <20171010154156.31440-1-pierre-alain.toret@protonmail.com> Message-ID: <20171010154156.31440-4-pierre-alain.toret@protonmail.com> Signed-off-by: Pierre-Alain TORET --- .../openbsd/openbsd6.2/openbsd-6.2-amd64.txt | 33 ++++++++++++++++++++++ .../openbsd/openbsd6.2/openbsd-6.2-i386.txt | 33 ++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 tests/isodata/openbsd/openbsd6.2/openbsd-6.2-amd64.txt create mode 100644 tests/isodata/openbsd/openbsd6.2/openbsd-6.2-i386.txt diff --git a/tests/isodata/openbsd/openbsd6.2/openbsd-6.2-amd64.txt b/tests/isodata/openbsd/openbsd6.2/openbsd-6.2-amd64.txt new file mode 100644 index 0000000..c0dbb6a --- /dev/null +++ b/tests/isodata/openbsd/openbsd6.2/openbsd-6.2-amd64.txt @@ -0,0 +1,33 @@ +CD-ROM is in ISO 9660 format +System id: OpenBSD +Volume id: OpenBSD/amd64 6.2 Install CD +Volume set id: +Publisher id: Copyright (c) 2017 Theo de Raadt, The OpenBSD project +Data preparer id: Theo de Raadt +Application id: OpenBSD 6.2 amd64 Install CD +Copyright File id: +Abstract File id: +Bibliographic File id: +Volume set size is: 1 +Volume set sequence number is: 1 +Logical block size is: 2048 +Volume size is: 169081 +El Torito VD version 1 found, boot catalog is in sector 71630 +NO Joliet present + +SUSP signatures version 1 found +Rock Ridge signatures version 1 found +Rock Ridge id 'RRIP_1991A' +Eltorito validation header: + Hid 1 + Arch 0 (x86) + ID 'Copyright (c) 2017 Theo' + Cksum FF D5 OK + Key 55 AA + Eltorito defaultboot header: + Bootid 88 (bootable) + Boot media 0 (No Emulation Boot) + Load segment 0 + Sys type 0 + Nsect 4 + Bootoff 15CBB 89275 diff --git a/tests/isodata/openbsd/openbsd6.2/openbsd-6.2-i386.txt b/tests/isodata/openbsd/openbsd6.2/openbsd-6.2-i386.txt new file mode 100644 index 0000000..8d7c36f --- /dev/null +++ b/tests/isodata/openbsd/openbsd6.2/openbsd-6.2-i386.txt @@ -0,0 +1,33 @@ +CD-ROM is in ISO 9660 format +System id: OpenBSD +Volume id: OpenBSD/i386 6.2 Install CD +Volume set id: +Publisher id: Copyright (c) 2017 Theo de Raadt, The OpenBSD project +Data preparer id: Theo de Raadt +Application id: OpenBSD 6.2 i386 Install CD +Copyright File id: +Abstract File id: +Bibliographic File id: +Volume set size is: 1 +Volume set sequence number is: 1 +Logical block size is: 2048 +Volume size is: 163997 +El Torito VD version 1 found, boot catalog is in sector 71052 +NO Joliet present + +SUSP signatures version 1 found +Rock Ridge signatures version 1 found +Rock Ridge id 'RRIP_1991A' +Eltorito validation header: + Hid 1 + Arch 0 (x86) + ID 'Copyright (c) 2017 Theo' + Cksum FF D5 OK + Key 55 AA + Eltorito defaultboot header: + Bootid 88 (bootable) + Boot media 0 (No Emulation Boot) + Load segment 0 + Sys type 0 + Nsect 4 + Bootoff 155AD 87469 -- 2.14.2 From cfergeau at redhat.com Mon Oct 16 09:09:33 2017 From: cfergeau at redhat.com (Christophe Fergeau) Date: Mon, 16 Oct 2017 11:09:33 +0200 Subject: [Libosinfo] [PATCH osinfo-db 0/3] openbsd: add OpenBSD 6.0 6.1 6.2 info In-Reply-To: <20171010153943.31305-1-pierre-alain.toret@protonmail.com> References: <20171010153943.31305-1-pierre-alain.toret@protonmail.com> Message-ID: <20171016090933.GH29716@natto.ory.fergeau.eu> For the series, Acked-by: Christophe Fergeau I'll push it shortly. Thanks for the patches ! On Tue, Oct 10, 2017 at 05:39:40PM +0200, Pierre-Alain TORET wrote: > Pierre-Alain TORET (3): > openbsd: add OpenBSD 6.0 info > openbsd: add OpenBSD 6.1 info > openbsd: add OpenBSD 6.2 info > > data/os/openbsd.org/openbsd-6.0.xml.in | 35 ++++++++++++++++++++++++++++++++++ > data/os/openbsd.org/openbsd-6.1.xml.in | 35 ++++++++++++++++++++++++++++++++++ > data/os/openbsd.org/openbsd-6.2.xml.in | 35 ++++++++++++++++++++++++++++++++++ > 3 files changed, 105 insertions(+) > create mode 100644 data/os/openbsd.org/openbsd-6.0.xml.in > create mode 100644 data/os/openbsd.org/openbsd-6.1.xml.in > create mode 100644 data/os/openbsd.org/openbsd-6.2.xml.in > > -- > 2.14.2 > > _______________________________________________ > Libosinfo mailing list > Libosinfo at redhat.com > https://www.redhat.com/mailman/listinfo/libosinfo -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From cfergeau at redhat.com Mon Oct 16 09:09:52 2017 From: cfergeau at redhat.com (Christophe Fergeau) Date: Mon, 16 Oct 2017 11:09:52 +0200 Subject: [Libosinfo] [PATCH libosinfo 0/3] openbsd: add OpenBSD 6.0 6.1 6.2 isodata In-Reply-To: <20171010154156.31440-1-pierre-alain.toret@protonmail.com> References: <20171010154156.31440-1-pierre-alain.toret@protonmail.com> Message-ID: <20171016090952.GI29716@natto.ory.fergeau.eu> Acked-by: Christophe Fergeau for the series, I'll push it to gitlab soon. Christophe On Tue, Oct 10, 2017 at 05:41:53PM +0200, Pierre-Alain TORET wrote: > Pierre-Alain TORET (3): > openbsd: add OpenBSD 6.0 isodata > openbsd: add OpenBSD 6.1 isodata > openbsd: add OpenBSD 6.2 isodata > > .../openbsd/openbsd6.0/openbsd-6.0-amd64.txt | 33 ++++++++++++++++++++++ > .../openbsd/openbsd6.0/openbsd-6.0-i386.txt | 33 ++++++++++++++++++++++ > .../openbsd/openbsd6.1/openbsd-6.1-amd64.txt | 33 ++++++++++++++++++++++ > .../openbsd/openbsd6.1/openbsd-6.1-i386.txt | 33 ++++++++++++++++++++++ > .../openbsd/openbsd6.2/openbsd-6.2-amd64.txt | 33 ++++++++++++++++++++++ > .../openbsd/openbsd6.2/openbsd-6.2-i386.txt | 33 ++++++++++++++++++++++ > 6 files changed, 198 insertions(+) > create mode 100644 tests/isodata/openbsd/openbsd6.0/openbsd-6.0-amd64.txt > create mode 100644 tests/isodata/openbsd/openbsd6.0/openbsd-6.0-i386.txt > create mode 100644 tests/isodata/openbsd/openbsd6.1/openbsd-6.1-amd64.txt > create mode 100644 tests/isodata/openbsd/openbsd6.1/openbsd-6.1-i386.txt > create mode 100644 tests/isodata/openbsd/openbsd6.2/openbsd-6.2-amd64.txt > create mode 100644 tests/isodata/openbsd/openbsd6.2/openbsd-6.2-i386.txt > > -- > 2.14.2 > > _______________________________________________ > Libosinfo mailing list > Libosinfo at redhat.com > https://www.redhat.com/mailman/listinfo/libosinfo -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From cfergeau at redhat.com Mon Oct 16 09:10:08 2017 From: cfergeau at redhat.com (Christophe Fergeau) Date: Mon, 16 Oct 2017 11:10:08 +0200 Subject: [Libosinfo] [PATCH libosinfo] openbsd: add OpenBSD 5.9 isodata In-Reply-To: <20171005154542.26852-1-pierre-alain.toret@protonmail.com> References: <20171005154542.26852-1-pierre-alain.toret@protonmail.com> Message-ID: <20171016091008.GJ29716@natto.ory.fergeau.eu> Acked-by: Christophe Fergeau On Thu, Oct 05, 2017 at 05:45:42PM +0200, Pierre-Alain TORET wrote: > Signed-off-by: Pierre-Alain TORET > --- > .../openbsd/openbsd5.9/openbsd-5.9-amd64.txt | 33 ++++++++++++++++++++++ > .../openbsd/openbsd5.9/openbsd-5.9-i386.txt | 33 ++++++++++++++++++++++ > 2 files changed, 66 insertions(+) > create mode 100644 tests/isodata/openbsd/openbsd5.9/openbsd-5.9-amd64.txt > create mode 100644 tests/isodata/openbsd/openbsd5.9/openbsd-5.9-i386.txt > > diff --git a/tests/isodata/openbsd/openbsd5.9/openbsd-5.9-amd64.txt b/tests/isodata/openbsd/openbsd5.9/openbsd-5.9-amd64.txt > new file mode 100644 > index 0000000..5070cad > --- /dev/null > +++ b/tests/isodata/openbsd/openbsd5.9/openbsd-5.9-amd64.txt > @@ -0,0 +1,33 @@ > +CD-ROM is in ISO 9660 format > +System id: OpenBSD > +Volume id: OpenBSD/amd64 5.9 Install CD > +Volume set id: > +Publisher id: Copyright (c) 2016 Theo de Raadt, The OpenBSD project > +Data preparer id: Theo de Raadt > +Application id: OpenBSD 5.9 amd64 Install CD > +Copyright File id: > +Abstract File id: > +Bibliographic File id: > +Volume set size is: 1 > +Volume set sequence number is: 1 > +Logical block size is: 2048 > +Volume size is: 114093 > +El Torito VD version 1 found, boot catalog is in sector 25835 > +NO Joliet present > + > +SUSP signatures version 1 found > +Rock Ridge signatures version 1 found > +Rock Ridge id 'RRIP_1991A' > +Eltorito validation header: > + Hid 1 > + Arch 0 (x86) > + ID 'Copyright (c) 2016 Theo' > + Cksum FF D6 OK > + Key 55 AA > + Eltorito defaultboot header: > + Bootid 88 (bootable) > + Boot media 0 (No Emulation Boot) > + Load segment 0 > + Sys type 0 > + Nsect 4 > + Bootoff 9B0B 39691 > diff --git a/tests/isodata/openbsd/openbsd5.9/openbsd-5.9-i386.txt b/tests/isodata/openbsd/openbsd5.9/openbsd-5.9-i386.txt > new file mode 100644 > index 0000000..0b7fae9 > --- /dev/null > +++ b/tests/isodata/openbsd/openbsd5.9/openbsd-5.9-i386.txt > @@ -0,0 +1,33 @@ > +CD-ROM is in ISO 9660 format > +System id: OpenBSD > +Volume id: OpenBSD/i386 5.9 Install CD > +Volume set id: > +Publisher id: Copyright (c) 2016 Theo de Raadt, The OpenBSD project > +Data preparer id: Theo de Raadt > +Application id: OpenBSD 5.9 i386 Install CD > +Copyright File id: > +Abstract File id: > +Bibliographic File id: > +Volume set size is: 1 > +Volume set sequence number is: 1 > +Logical block size is: 2048 > +Volume size is: 108955 > +El Torito VD version 1 found, boot catalog is in sector 24333 > +NO Joliet present > + > +SUSP signatures version 1 found > +Rock Ridge signatures version 1 found > +Rock Ridge id 'RRIP_1991A' > +Eltorito validation header: > + Hid 1 > + Arch 0 (x86) > + ID 'Copyright (c) 2016 Theo' > + Cksum FF D6 OK > + Key 55 AA > + Eltorito defaultboot header: > + Bootid 88 (bootable) > + Boot media 0 (No Emulation Boot) > + Load segment 0 > + Sys type 0 > + Nsect 4 > + Bootoff 95D4 38356 > -- > 2.14.2 > > _______________________________________________ > Libosinfo mailing list > Libosinfo at redhat.com > https://www.redhat.com/mailman/listinfo/libosinfo -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From cfergeau at redhat.com Mon Oct 16 09:10:13 2017 From: cfergeau at redhat.com (Christophe Fergeau) Date: Mon, 16 Oct 2017 11:10:13 +0200 Subject: [Libosinfo] [PATCH osinfo-db] openbsd: add OpenBSD 5.9 info In-Reply-To: <20171005154503.26775-1-pierre-alain.toret@protonmail.com> References: <20171005154503.26775-1-pierre-alain.toret@protonmail.com> Message-ID: <20171016091013.GK29716@natto.ory.fergeau.eu> Acked-by: Christophe Fergeau On Thu, Oct 05, 2017 at 05:45:03PM +0200, Pierre-Alain TORET wrote: > Signed-off-by: Pierre-Alain TORET > --- > data/os/openbsd.org/openbsd-5.9.xml.in | 35 ++++++++++++++++++++++++++++++++++ > 1 file changed, 35 insertions(+) > create mode 100644 data/os/openbsd.org/openbsd-5.9.xml.in > > diff --git a/data/os/openbsd.org/openbsd-5.9.xml.in b/data/os/openbsd.org/openbsd-5.9.xml.in > new file mode 100644 > index 0000000..8a66aed > --- /dev/null > +++ b/data/os/openbsd.org/openbsd-5.9.xml.in > @@ -0,0 +1,35 @@ > + > + > + > + openbsd5.9 > + <_name>OpenBSD 5.9 > + 5.9 > + openbsd > + openbsd > + <_vendor>OpenBSD Project > + > + > + 2016-03-29 > + > + > + https://fastly.cdn.openbsd.org/pub/OpenBSD/5.9/i386/install59.iso > + > + The OpenBSD project > + OpenBSD > + OpenBSD/i386 5.9 Install CD > + OpenBSD 5.9 i386 Install CD > + > + > + > + > + https://fastly.cdn.openbsd.org/pub/OpenBSD/5.9/amd64/install59.iso > + > + The OpenBSD project > + OpenBSD > + OpenBSD/amd64 5.9 Install CD > + OpenBSD 5.9 amd64 Install CD > + > + > + > + > -- > 2.14.2 > > _______________________________________________ > Libosinfo mailing list > Libosinfo at redhat.com > https://www.redhat.com/mailman/listinfo/libosinfo -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From cfergeau at redhat.com Mon Oct 16 09:10:42 2017 From: cfergeau at redhat.com (Christophe Fergeau) Date: Mon, 16 Oct 2017 11:10:42 +0200 Subject: [Libosinfo] [PATCH osinfo-db] freebsd: add FreeBSD 10.4 info In-Reply-To: <20171005103841.26129-1-bogorodskiy@gmail.com> References: <20171005103841.26129-1-bogorodskiy@gmail.com> Message-ID: <20171016091042.GL29716@natto.ory.fergeau.eu> On Thu, Oct 05, 2017 at 02:38:41PM +0400, Roman Bogorodskiy wrote: > --- > data/os/freebsd.org/freebsd-10.4.xml.in | 51 +++++++++++++++++++++++++++++++++ > 1 file changed, 51 insertions(+) > create mode 100644 data/os/freebsd.org/freebsd-10.4.xml.in > > diff --git a/data/os/freebsd.org/freebsd-10.4.xml.in b/data/os/freebsd.org/freebsd-10.4.xml.in > new file mode 100644 > index 0000000..5697b69 > --- /dev/null > +++ b/data/os/freebsd.org/freebsd-10.4.xml.in > @@ -0,0 +1,51 @@ > + > + > + > + freebsd10.4 > + <_name>FreeBSD 10.4 > + 10.4 > + <_vendor>FreeBSD Project > + freebsd > + freebsd > + > + There was some conversation on IRC regarding upgrades VS derives-from, I don't think derives-from is needed here. Apart from this, Acked-by: Christophe Fergeau Christophe -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From cfergeau at redhat.com Mon Oct 16 09:10:48 2017 From: cfergeau at redhat.com (Christophe Fergeau) Date: Mon, 16 Oct 2017 11:10:48 +0200 Subject: [Libosinfo] [PATCH libosinfo] freebsd: Add FreeBSD 10.4 isodata In-Reply-To: <20171005104043.26327-1-bogorodskiy@gmail.com> References: <20171005104043.26327-1-bogorodskiy@gmail.com> Message-ID: <20171016091048.GM29716@natto.ory.fergeau.eu> Acked-by: Christophe Fergeau On Thu, Oct 05, 2017 at 02:40:43PM +0400, Roman Bogorodskiy wrote: > --- > .../FreeBSD-10.4-RELEASE-amd64-disc1.iso.txt | 33 ++++++++++++++++++++++ > .../FreeBSD-10.4-RELEASE-amd64-dvd1.iso.txt | 33 ++++++++++++++++++++++ > .../FreeBSD-10.4-RELEASE-i386-disc1.iso.txt | 33 ++++++++++++++++++++++ > .../FreeBSD-10.4-RELEASE-i386-dvd1.iso.txt | 33 ++++++++++++++++++++++ > 4 files changed, 132 insertions(+) > create mode 100644 tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-amd64-disc1.iso.txt > create mode 100644 tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-amd64-dvd1.iso.txt > create mode 100644 tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-i386-disc1.iso.txt > create mode 100644 tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-i386-dvd1.iso.txt > > diff --git a/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-amd64-disc1.iso.txt b/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-amd64-disc1.iso.txt > new file mode 100644 > index 0000000..c0ae09d > --- /dev/null > +++ b/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-amd64-disc1.iso.txt > @@ -0,0 +1,33 @@ > +CD-ROM is in ISO 9660 format > +System id: FreeBSD > +Volume id: 10_4_RELEASE_AMD64_CD > +Volume set id: > +Publisher id: THE FREEBSD PROJECT. HTTP://WWW.FREEBSD.ORG/ > +Data preparer id: > +Application id: > +Copyright File id: > +Abstract File id: > +Bibliographic File id: > +Volume set size is: 1 > +Volume set sequence number is: 1 > +Logical block size is: 2048 > +Volume size is: 313305 > +El Torito VD version 1 found, boot catalog is in sector 19 > +NO Joliet present > + > +SUSP signatures version 1 found > +Rock Ridge signatures version 1 found > +Rock Ridge id 'IEEE_P1282' > +Eltorito validation header: > + Hid 1 > + Arch 0 (x86) > + ID '' > + Cksum AA 55 OK > + Key 55 AA > + Eltorito defaultboot header: > + Bootid 88 (bootable) > + Boot media 0 (No Emulation Boot) > + Load segment 0 > + Sys type 0 > + Nsect 4 > + Bootoff 14 20 > diff --git a/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-amd64-dvd1.iso.txt b/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-amd64-dvd1.iso.txt > new file mode 100644 > index 0000000..e7c27a3 > --- /dev/null > +++ b/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-amd64-dvd1.iso.txt > @@ -0,0 +1,33 @@ > +CD-ROM is in ISO 9660 format > +System id: FreeBSD > +Volume id: 10_4_RELEASE_AMD64_DVD > +Volume set id: > +Publisher id: THE FREEBSD PROJECT. HTTP://WWW.FREEBSD.ORG/ > +Data preparer id: > +Application id: > +Copyright File id: > +Abstract File id: > +Bibliographic File id: > +Volume set size is: 1 > +Volume set sequence number is: 1 > +Logical block size is: 2048 > +Volume size is: 1484567 > +El Torito VD version 1 found, boot catalog is in sector 19 > +NO Joliet present > + > +SUSP signatures version 1 found > +Rock Ridge signatures version 1 found > +Rock Ridge id 'IEEE_P1282' > +Eltorito validation header: > + Hid 1 > + Arch 0 (x86) > + ID '' > + Cksum AA 55 OK > + Key 55 AA > + Eltorito defaultboot header: > + Bootid 88 (bootable) > + Boot media 0 (No Emulation Boot) > + Load segment 0 > + Sys type 0 > + Nsect 4 > + Bootoff 14 20 > diff --git a/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-i386-disc1.iso.txt b/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-i386-disc1.iso.txt > new file mode 100644 > index 0000000..a582b20 > --- /dev/null > +++ b/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-i386-disc1.iso.txt > @@ -0,0 +1,33 @@ > +CD-ROM is in ISO 9660 format > +System id: FreeBSD > +Volume id: 10_4_RELEASE_I386_CD > +Volume set id: > +Publisher id: THE FREEBSD PROJECT. HTTP://WWW.FREEBSD.ORG/ > +Data preparer id: > +Application id: > +Copyright File id: > +Abstract File id: > +Bibliographic File id: > +Volume set size is: 1 > +Volume set sequence number is: 1 > +Logical block size is: 2048 > +Volume size is: 277985 > +El Torito VD version 1 found, boot catalog is in sector 19 > +NO Joliet present > + > +SUSP signatures version 1 found > +Rock Ridge signatures version 1 found > +Rock Ridge id 'IEEE_P1282' > +Eltorito validation header: > + Hid 1 > + Arch 0 (x86) > + ID '' > + Cksum AA 55 OK > + Key 55 AA > + Eltorito defaultboot header: > + Bootid 88 (bootable) > + Boot media 0 (No Emulation Boot) > + Load segment 0 > + Sys type 0 > + Nsect 4 > + Bootoff 14 20 > diff --git a/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-i386-dvd1.iso.txt b/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-i386-dvd1.iso.txt > new file mode 100644 > index 0000000..8e913b4 > --- /dev/null > +++ b/tests/isodata/freebsd/freebsd10.4/FreeBSD-10.4-RELEASE-i386-dvd1.iso.txt > @@ -0,0 +1,33 @@ > +CD-ROM is in ISO 9660 format > +System id: FreeBSD > +Volume id: 10_4_RELEASE_I386_DVD > +Volume set id: > +Publisher id: THE FREEBSD PROJECT. HTTP://WWW.FREEBSD.ORG/ > +Data preparer id: > +Application id: > +Copyright File id: > +Abstract File id: > +Bibliographic File id: > +Volume set size is: 1 > +Volume set sequence number is: 1 > +Logical block size is: 2048 > +Volume size is: 1373155 > +El Torito VD version 1 found, boot catalog is in sector 19 > +NO Joliet present > + > +SUSP signatures version 1 found > +Rock Ridge signatures version 1 found > +Rock Ridge id 'IEEE_P1282' > +Eltorito validation header: > + Hid 1 > + Arch 0 (x86) > + ID '' > + Cksum AA 55 OK > + Key 55 AA > + Eltorito defaultboot header: > + Bootid 88 (bootable) > + Boot media 0 (No Emulation Boot) > + Load segment 0 > + Sys type 0 > + Nsect 4 > + Bootoff 14 20 > -- > 2.14.1 > > _______________________________________________ > Libosinfo mailing list > Libosinfo at redhat.com > https://www.redhat.com/mailman/listinfo/libosinfo -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From cfergeau at redhat.com Mon Oct 16 09:14:22 2017 From: cfergeau at redhat.com (Christophe Fergeau) Date: Mon, 16 Oct 2017 11:14:22 +0200 Subject: [Libosinfo] [libosinfo PATCH] tests: test-mediauris: raise timeout to 5 minutes In-Reply-To: References: <20170807114450.30295-1-ptoscano@redhat.com> Message-ID: <20171016091422.GN29716@natto.ory.fergeau.eu> Noticed this was never pushed, I've just done it. On Mon, Aug 07, 2017 at 04:09:42PM -0400, Cole Robinson wrote: > On 08/07/2017 07:44 AM, Pino Toscano wrote: > > With the growing amount of distros in osinfo-db, the test takes more > > and more time to complete, hitting the 2 minutes timeout in case of any > > network hiccup (or simply when a server takes more time to reply). > > > > Hence, raise the timeout to 5 minutes, which ought to be enough now. > > --- > > tests/test-mediauris.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tests/test-mediauris.c b/tests/test-mediauris.c > > index 1b330ed..837197c 100644 > > --- a/tests/test-mediauris.c > > +++ b/tests/test-mediauris.c > > @@ -113,7 +113,7 @@ list_suite(void) > > { > > Suite *s = suite_create("List"); > > TCase *tc = tcase_create("Core"); > > - tcase_set_timeout(tc, 120); > > + tcase_set_timeout(tc, 300); > > > > tcase_add_test(tc, test_uris); > > suite_add_tcase(s, tc); > > > > ACK, seems sensible to me > > - Cole > > _______________________________________________ > Libosinfo mailing list > Libosinfo at redhat.com > https://www.redhat.com/mailman/listinfo/libosinfo -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From cfergeau at redhat.com Mon Oct 16 09:14:39 2017 From: cfergeau at redhat.com (Christophe Fergeau) Date: Mon, 16 Oct 2017 11:14:39 +0200 Subject: [Libosinfo] [libosinfo PATCH 0/2] Switch from libsoup to libcurl In-Reply-To: <20170807161835.23604-1-ptoscano@redhat.com> References: <20170807161835.23604-1-ptoscano@redhat.com> Message-ID: <20171016091439.GO29716@natto.ory.fergeau.eu> Finally pushed this series. Christophe On Mon, Aug 07, 2017 at 06:18:33PM +0200, Pino Toscano wrote: > Hi, > > currently, libosinfo requires [1] libsoup for two tests, to check the > validity of all the URLs in osinfo-db; while simple to use, libsoup is > HTTP only, and thus cannot be used to validate other protocols used in > osinfo-db (like ftp). > > This series proposes the switch from libsoup to libcurl -- it has the > following advantages: > - ftp (and other) URLs can be tested > - slightly more flexible than libsoup > - stable library, widely available, portable, and with a liberal > license (MIT) > > [1] even if just for two tests, not for the main library nor the tools > -- maybe a followup patch could be loosen the requirement, and > conditionalize the build of those tests only when libsoup/libcurl > is present > > Thanks, > > Pino Toscano (2): > Switch from libsoup to libcurl > Revert "tests: test-mediauris: skip non-http URLs" > > README | 2 +- > configure.ac | 12 +++--------- > libosinfo.spec.in | 2 +- > mingw-libosinfo.spec.in | 4 ++-- > tests/Makefile.am | 4 ++-- > tests/test-mediauris.c | 42 +++++++++++++++++++++++++----------------- > tests/test-treeuris.c | 39 ++++++++++++++++++++++++--------------- > 7 files changed, 58 insertions(+), 47 deletions(-) > > -- > 2.13.4 > > _______________________________________________ > Libosinfo mailing list > Libosinfo at redhat.com > https://www.redhat.com/mailman/listinfo/libosinfo -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From cfergeau at redhat.com Mon Oct 16 12:20:59 2017 From: cfergeau at redhat.com (Christophe Fergeau) Date: Mon, 16 Oct 2017 14:20:59 +0200 Subject: [Libosinfo] [PATCH] Marginally simplify the code to create and run a GMainLoop In-Reply-To: <20170208101620.q7e4squumv6jkox4@edamame.cdg.redhat.com> References: <20170117142941.5412-1-rishi.is@lostca.se> <20170207170353.pfn5uwgvfz3ybks2@edamame.cdg.redhat.com> <20170208101620.q7e4squumv6jkox4@edamame.cdg.redhat.com> Message-ID: <20171016122059.GR29716@natto.ory.fergeau.eu> Hey, On Wed, Feb 08, 2017 at 11:16:20AM +0100, Christophe Fergeau wrote: > On Tue, Feb 07, 2017 at 06:03:53PM +0100, Christophe Fergeau wrote: > > On Tue, Jan 17, 2017 at 03:29:41PM +0100, Debarshi Ray wrote: > > > From: Debarshi Ray > > > > > > Even though g_main_loop_new accepts a is_running parameter, it isn't > > > very important since g_main_loop_run will set it to TRUE anyway. There > > > is no requirement that it should be set before calling g_main_loop_run. > > > The vast majority of GMainLoop users simply ignore the is_running > > > parameter unless they are doing something out of the ordinary. > > > > Hey, looking for example at osinfo_install_script_generate(), which is > > > > GMainLoop *loop = g_main_loop_new(g_main_context_get_thread_default(), > > TRUE); > > OsinfoInstallScriptGenerateSyncData data = { > > loop, NULL, NULL, NULL > > }; > > > > osinfo_install_script_generate_async(script, > > os, > > config, > > cancellable, > > osinfo_install_script_generate_done, > > &data); > > > > if (g_main_loop_is_running(loop)) > > g_main_loop_run(loop); > > > > Isn't the way it's currently done going to catch cases when > > osinfo_install_script_generate_done (and thus g_main_loop_quit()) ends up being > > called synchronously at the moment osinfo_install_script_generate_async() is > > called, while with your change, we'd wait forever for a g_main_loop_quit() > > which never comes? > > Looks like this could cause problems if g_main_loop_quit() can be called > before the main loop starts running, I tested with this: Just took another look at it, and we don't have this situation currently in libosinfo codebase, so your patch should be fine. Acked-by: Christophe Fergeau Have you sent the follow-up that you mention to use a non-default GMainContext for these operations? I have memories of seeing such a patch, but could not find it on the mailing list. Christophe -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From ptoscano at redhat.com Tue Oct 17 07:02:36 2017 From: ptoscano at redhat.com (Pino Toscano) Date: Tue, 17 Oct 2017 09:02:36 +0200 Subject: [Libosinfo] [osinfo-db PATCH] fedora: Fix URLs for EOL version Message-ID: <20171017070236.29477-1-ptoscano@redhat.com> Fedora versions earlier than 25 are EOL now, so their files are in the archive. --- data/os/fedoraproject.org/fedora-22.xml.in | 20 ++++++++++---------- data/os/fedoraproject.org/fedora-23.xml.in | 20 ++++++++++---------- data/os/fedoraproject.org/fedora-24.xml.in | 20 ++++++++++---------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/data/os/fedoraproject.org/fedora-22.xml.in b/data/os/fedoraproject.org/fedora-22.xml.in index 57fd234..6b980a4 100644 --- a/data/os/fedoraproject.org/fedora-22.xml.in +++ b/data/os/fedoraproject.org/fedora-22.xml.in @@ -32,7 +32,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Workstation/i386/iso/Fedora-Live-Workstation-i686-22-3.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Workstation/i386/iso/Fedora-Live-Workstation-i686-22-3.iso Fedora-Live-WS-i686-22.* LINUX @@ -43,7 +43,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Workstation/x86_64/iso/Fedora-Live-Workstation-x86_64-22-3.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Workstation/x86_64/iso/Fedora-Live-Workstation-x86_64-22-3.iso Fedora-Live-WS-x86_64-22.* LINUX @@ -56,7 +56,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Workstation/i386/iso/Fedora-Workstation-netinst-i386-22.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Workstation/i386/iso/Fedora-Workstation-netinst-i386-22.iso Fedora-22-i386 LINUX @@ -67,7 +67,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Workstation/x86_64/iso/Fedora-Workstation-netinst-x86_64-22.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Workstation/x86_64/iso/Fedora-Workstation-netinst-x86_64-22.iso Fedora-22-x86_64 LINUX @@ -82,7 +82,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Server/i386/iso/Fedora-Server-DVD-i386-22.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Server/i386/iso/Fedora-Server-DVD-i386-22.iso Fedora-22-i386 LINUX @@ -93,7 +93,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Server/x86_64/iso/Fedora-Server-DVD-x86_64-22.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Server/x86_64/iso/Fedora-Server-DVD-x86_64-22.iso Fedora-22-x86_64 LINUX @@ -106,7 +106,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Server/i386/iso/Fedora-Server-netinst-i386-22.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Server/i386/iso/Fedora-Server-netinst-i386-22.iso Fedora-22-i386 LINUX @@ -117,7 +117,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Server/x86_64/iso/Fedora-Server-netinst-x86_64-22.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Server/x86_64/iso/Fedora-Server-netinst-x86_64-22.iso Fedora-22-x86_64 LINUX @@ -129,7 +129,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Server/i386/os/ + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Server/i386/os/ Fedora 22 @@ -137,7 +137,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Server/x86_64/os/ + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Server/x86_64/os/ Fedora diff --git a/data/os/fedoraproject.org/fedora-23.xml.in b/data/os/fedoraproject.org/fedora-23.xml.in index 61d4116..2711620 100644 --- a/data/os/fedoraproject.org/fedora-23.xml.in +++ b/data/os/fedoraproject.org/fedora-23.xml.in @@ -45,7 +45,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Workstation/i386/iso/Fedora-Live-Workstation-i686-23-10.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Workstation/i386/iso/Fedora-Live-Workstation-i686-23-10.iso Fedora-Live-WS-i686-23.* LINUX @@ -55,7 +55,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Workstation/x86_64/iso/Fedora-Live-Workstation-x86_64-23-10.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Workstation/x86_64/iso/Fedora-Live-Workstation-x86_64-23-10.iso Fedora-Live-WS-x86_64-23.* LINUX @@ -67,7 +67,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Workstation/i386/iso/Fedora-Workstation-netinst-i386-23.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Workstation/i386/iso/Fedora-Workstation-netinst-i386-23.iso Fedora-WS-23(_[[:alpha:]]*)*-i386 LINUX @@ -77,7 +77,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Workstation/x86_64/iso/Fedora-Workstation-netinst-x86_64-23.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Workstation/x86_64/iso/Fedora-Workstation-netinst-x86_64-23.iso Fedora-WS-23(_[[:alpha:]]*)*-x86_64 LINUX @@ -91,7 +91,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Server/i386/iso/Fedora-Server-DVD-i386-23.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Server/i386/iso/Fedora-Server-DVD-i386-23.iso Fedora-S-23(_[[:alpha:]]*)*-i386 LINUX @@ -106,7 +106,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Server/x86_64/iso/Fedora-Server-DVD-x86_64-23.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Server/x86_64/iso/Fedora-Server-DVD-x86_64-23.iso Fedora-S-23(_[[:alpha:]]*)*-x86_64 LINUX @@ -119,7 +119,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Server/i386/iso/Fedora-Server-netinst-i386-23.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Server/i386/iso/Fedora-Server-netinst-i386-23.iso Fedora-S-23(_[[:alpha:]]*)*-i386 LINUX @@ -130,7 +130,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Server/x86_64/iso/Fedora-Server-netinst-x86_64-23.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Server/x86_64/iso/Fedora-Server-netinst-x86_64-23.iso Fedora-S-23(_[[:alpha:]]*)*-x86_64 LINUX @@ -142,7 +142,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Server/i386/os/ + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Server/i386/os/ Fedora 23 @@ -150,7 +150,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Server/x86_64/os/ + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Server/x86_64/os/ Fedora diff --git a/data/os/fedoraproject.org/fedora-24.xml.in b/data/os/fedoraproject.org/fedora-24.xml.in index 495b068..a405b6d 100644 --- a/data/os/fedoraproject.org/fedora-24.xml.in +++ b/data/os/fedoraproject.org/fedora-24.xml.in @@ -36,7 +36,7 @@ - https://download.fedoraproject.org/pub/fedora/linux/releases/24/Workstation/i386/iso/Fedora-Workstation-Live-i386-24-1.2.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Workstation/i386/iso/Fedora-Workstation-Live-i386-24-1.2.iso Fedora-WS-Live-24.* LINUX @@ -46,7 +46,7 @@ - https://download.fedoraproject.org/pub/fedora/linux/releases/24/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-24-1.2.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-24-1.2.iso Fedora-WS-Live-24.* LINUX @@ -58,7 +58,7 @@ - https://download.fedoraproject.org/pub/fedora/linux/releases/24/Workstation/i386/iso/Fedora-Workstation-netinst-i386-24-1.2.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Workstation/i386/iso/Fedora-Workstation-netinst-i386-24-1.2.iso Fedora-WS-dvd-i386-24 LINUX @@ -68,7 +68,7 @@ - https://download.fedoraproject.org/pub/fedora/linux/releases/24/Workstation/x86_64/iso/Fedora-Workstation-netinst-x86_64-24-1.2.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Workstation/x86_64/iso/Fedora-Workstation-netinst-x86_64-24-1.2.iso Fedora-WS-dvd-x86_64-24 LINUX @@ -82,7 +82,7 @@ - https://download.fedoraproject.org/pub/fedora/linux/releases/24/Server/i386/iso/Fedora-Server-dvd-i386-24-1.2.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Server/i386/iso/Fedora-Server-dvd-i386-24-1.2.iso Fedora-S-dvd-i386-24 LINUX @@ -97,7 +97,7 @@ - https://download.fedoraproject.org/pub/fedora/linux/releases/24/Server/x86_64/iso/Fedora-Server-dvd-x86_64-24-1.2.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Server/x86_64/iso/Fedora-Server-dvd-x86_64-24-1.2.iso Fedora-S-dvd-x86_64-24 LINUX @@ -110,7 +110,7 @@ - https://download.fedoraproject.org/pub/fedora/linux/releases/24/Server/i386/iso/Fedora-Server-netinst-i386-24-1.2.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Server/i386/iso/Fedora-Server-netinst-i386-24-1.2.iso Fedora-S-dvd-i386-24 LINUX @@ -121,7 +121,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/24/Server/x86_64/iso/Fedora-Server-netinst-x86_64-24-1.2.iso + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Server/x86_64/iso/Fedora-Server-netinst-x86_64-24-1.2.iso Fedora-S-dvd-x86_64-24 LINUX @@ -133,7 +133,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/24/Server/i386/os/ + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Server/i386/os/ Fedora 24 @@ -141,7 +141,7 @@ - http://download.fedoraproject.org/pub/fedora/linux/releases/24/Server/x86_64/os/ + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Server/x86_64/os/ Fedora -- 2.13.6 From cfergeau at redhat.com Tue Oct 17 07:25:30 2017 From: cfergeau at redhat.com (Christophe Fergeau) Date: Tue, 17 Oct 2017 09:25:30 +0200 Subject: [Libosinfo] [osinfo-db PATCH] fedora: Fix URLs for EOL version In-Reply-To: <20171017070236.29477-1-ptoscano@redhat.com> References: <20171017070236.29477-1-ptoscano@redhat.com> Message-ID: <20171017072530.GB29716@natto.ory.fergeau.eu> Acked-by: Christophe Fergeau On Tue, Oct 17, 2017 at 09:02:36AM +0200, Pino Toscano wrote: > Fedora versions earlier than 25 are EOL now, so their files are in the > archive. > --- > data/os/fedoraproject.org/fedora-22.xml.in | 20 ++++++++++---------- > data/os/fedoraproject.org/fedora-23.xml.in | 20 ++++++++++---------- > data/os/fedoraproject.org/fedora-24.xml.in | 20 ++++++++++---------- > 3 files changed, 30 insertions(+), 30 deletions(-) > > diff --git a/data/os/fedoraproject.org/fedora-22.xml.in b/data/os/fedoraproject.org/fedora-22.xml.in > index 57fd234..6b980a4 100644 > --- a/data/os/fedoraproject.org/fedora-22.xml.in > +++ b/data/os/fedoraproject.org/fedora-22.xml.in > @@ -32,7 +32,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Workstation/i386/iso/Fedora-Live-Workstation-i686-22-3.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Workstation/i386/iso/Fedora-Live-Workstation-i686-22-3.iso > > Fedora-Live-WS-i686-22.* > LINUX > @@ -43,7 +43,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Workstation/x86_64/iso/Fedora-Live-Workstation-x86_64-22-3.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Workstation/x86_64/iso/Fedora-Live-Workstation-x86_64-22-3.iso > > Fedora-Live-WS-x86_64-22.* > LINUX > @@ -56,7 +56,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Workstation/i386/iso/Fedora-Workstation-netinst-i386-22.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Workstation/i386/iso/Fedora-Workstation-netinst-i386-22.iso > > Fedora-22-i386 > LINUX > @@ -67,7 +67,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Workstation/x86_64/iso/Fedora-Workstation-netinst-x86_64-22.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Workstation/x86_64/iso/Fedora-Workstation-netinst-x86_64-22.iso > > Fedora-22-x86_64 > LINUX > @@ -82,7 +82,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Server/i386/iso/Fedora-Server-DVD-i386-22.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Server/i386/iso/Fedora-Server-DVD-i386-22.iso > > Fedora-22-i386 > LINUX > @@ -93,7 +93,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Server/x86_64/iso/Fedora-Server-DVD-x86_64-22.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Server/x86_64/iso/Fedora-Server-DVD-x86_64-22.iso > > Fedora-22-x86_64 > LINUX > @@ -106,7 +106,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Server/i386/iso/Fedora-Server-netinst-i386-22.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Server/i386/iso/Fedora-Server-netinst-i386-22.iso > > Fedora-22-i386 > LINUX > @@ -117,7 +117,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Server/x86_64/iso/Fedora-Server-netinst-x86_64-22.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Server/x86_64/iso/Fedora-Server-netinst-x86_64-22.iso > > Fedora-22-x86_64 > LINUX > @@ -129,7 +129,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Server/i386/os/ > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Server/i386/os/ > > Fedora > 22 > @@ -137,7 +137,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/22/Server/x86_64/os/ > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/22/Server/x86_64/os/ > > > Fedora > diff --git a/data/os/fedoraproject.org/fedora-23.xml.in b/data/os/fedoraproject.org/fedora-23.xml.in > index 61d4116..2711620 100644 > --- a/data/os/fedoraproject.org/fedora-23.xml.in > +++ b/data/os/fedoraproject.org/fedora-23.xml.in > @@ -45,7 +45,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Workstation/i386/iso/Fedora-Live-Workstation-i686-23-10.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Workstation/i386/iso/Fedora-Live-Workstation-i686-23-10.iso > > Fedora-Live-WS-i686-23.* > LINUX > @@ -55,7 +55,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Workstation/x86_64/iso/Fedora-Live-Workstation-x86_64-23-10.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Workstation/x86_64/iso/Fedora-Live-Workstation-x86_64-23-10.iso > > Fedora-Live-WS-x86_64-23.* > LINUX > @@ -67,7 +67,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Workstation/i386/iso/Fedora-Workstation-netinst-i386-23.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Workstation/i386/iso/Fedora-Workstation-netinst-i386-23.iso > > Fedora-WS-23(_[[:alpha:]]*)*-i386 > LINUX > @@ -77,7 +77,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Workstation/x86_64/iso/Fedora-Workstation-netinst-x86_64-23.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Workstation/x86_64/iso/Fedora-Workstation-netinst-x86_64-23.iso > > Fedora-WS-23(_[[:alpha:]]*)*-x86_64 > LINUX > @@ -91,7 +91,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Server/i386/iso/Fedora-Server-DVD-i386-23.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Server/i386/iso/Fedora-Server-DVD-i386-23.iso > > Fedora-S-23(_[[:alpha:]]*)*-i386 > LINUX > @@ -106,7 +106,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Server/x86_64/iso/Fedora-Server-DVD-x86_64-23.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Server/x86_64/iso/Fedora-Server-DVD-x86_64-23.iso > > Fedora-S-23(_[[:alpha:]]*)*-x86_64 > LINUX > @@ -119,7 +119,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Server/i386/iso/Fedora-Server-netinst-i386-23.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Server/i386/iso/Fedora-Server-netinst-i386-23.iso > > Fedora-S-23(_[[:alpha:]]*)*-i386 > LINUX > @@ -130,7 +130,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Server/x86_64/iso/Fedora-Server-netinst-x86_64-23.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Server/x86_64/iso/Fedora-Server-netinst-x86_64-23.iso > > Fedora-S-23(_[[:alpha:]]*)*-x86_64 > LINUX > @@ -142,7 +142,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Server/i386/os/ > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Server/i386/os/ > > Fedora > 23 > @@ -150,7 +150,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/23/Server/x86_64/os/ > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/23/Server/x86_64/os/ > > > Fedora > diff --git a/data/os/fedoraproject.org/fedora-24.xml.in b/data/os/fedoraproject.org/fedora-24.xml.in > index 495b068..a405b6d 100644 > --- a/data/os/fedoraproject.org/fedora-24.xml.in > +++ b/data/os/fedoraproject.org/fedora-24.xml.in > @@ -36,7 +36,7 @@ > > > > - https://download.fedoraproject.org/pub/fedora/linux/releases/24/Workstation/i386/iso/Fedora-Workstation-Live-i386-24-1.2.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Workstation/i386/iso/Fedora-Workstation-Live-i386-24-1.2.iso > > Fedora-WS-Live-24.* > LINUX > @@ -46,7 +46,7 @@ > > > > - https://download.fedoraproject.org/pub/fedora/linux/releases/24/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-24-1.2.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-24-1.2.iso > > Fedora-WS-Live-24.* > LINUX > @@ -58,7 +58,7 @@ > > > > - https://download.fedoraproject.org/pub/fedora/linux/releases/24/Workstation/i386/iso/Fedora-Workstation-netinst-i386-24-1.2.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Workstation/i386/iso/Fedora-Workstation-netinst-i386-24-1.2.iso > > Fedora-WS-dvd-i386-24 > LINUX > @@ -68,7 +68,7 @@ > > > > - https://download.fedoraproject.org/pub/fedora/linux/releases/24/Workstation/x86_64/iso/Fedora-Workstation-netinst-x86_64-24-1.2.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Workstation/x86_64/iso/Fedora-Workstation-netinst-x86_64-24-1.2.iso > > Fedora-WS-dvd-x86_64-24 > LINUX > @@ -82,7 +82,7 @@ > > > > - https://download.fedoraproject.org/pub/fedora/linux/releases/24/Server/i386/iso/Fedora-Server-dvd-i386-24-1.2.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Server/i386/iso/Fedora-Server-dvd-i386-24-1.2.iso > > Fedora-S-dvd-i386-24 > LINUX > @@ -97,7 +97,7 @@ > > > > - https://download.fedoraproject.org/pub/fedora/linux/releases/24/Server/x86_64/iso/Fedora-Server-dvd-x86_64-24-1.2.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Server/x86_64/iso/Fedora-Server-dvd-x86_64-24-1.2.iso > > Fedora-S-dvd-x86_64-24 > LINUX > @@ -110,7 +110,7 @@ > > > > - https://download.fedoraproject.org/pub/fedora/linux/releases/24/Server/i386/iso/Fedora-Server-netinst-i386-24-1.2.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Server/i386/iso/Fedora-Server-netinst-i386-24-1.2.iso > > Fedora-S-dvd-i386-24 > LINUX > @@ -121,7 +121,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/24/Server/x86_64/iso/Fedora-Server-netinst-x86_64-24-1.2.iso > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Server/x86_64/iso/Fedora-Server-netinst-x86_64-24-1.2.iso > > Fedora-S-dvd-x86_64-24 > LINUX > @@ -133,7 +133,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/24/Server/i386/os/ > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Server/i386/os/ > > Fedora > 24 > @@ -141,7 +141,7 @@ > > > > - http://download.fedoraproject.org/pub/fedora/linux/releases/24/Server/x86_64/os/ > + https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/24/Server/x86_64/os/ > > > Fedora > -- > 2.13.6 > > _______________________________________________ > Libosinfo mailing list > Libosinfo at redhat.com > https://www.redhat.com/mailman/listinfo/libosinfo -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From bogorodskiy at gmail.com Tue Oct 17 09:00:38 2017 From: bogorodskiy at gmail.com (Roman Bogorodskiy) Date: Tue, 17 Oct 2017 13:00:38 +0400 Subject: [Libosinfo] [PATCH osinfo-db] freebsd: add FreeBSD 10.4 info In-Reply-To: <20171016091042.GL29716@natto.ory.fergeau.eu> References: <20171005103841.26129-1-bogorodskiy@gmail.com> <20171016091042.GL29716@natto.ory.fergeau.eu> Message-ID: <20171017084140.GA2649@kloomba> Christophe Fergeau wrote: > On Thu, Oct 05, 2017 at 02:38:41PM +0400, Roman Bogorodskiy wrote: > > --- > > data/os/freebsd.org/freebsd-10.4.xml.in | 51 +++++++++++++++++++++++++++++++++ > > 1 file changed, 51 insertions(+) > > create mode 100644 data/os/freebsd.org/freebsd-10.4.xml.in > > > > diff --git a/data/os/freebsd.org/freebsd-10.4.xml.in b/data/os/freebsd.org/freebsd-10.4.xml.in > > new file mode 100644 > > index 0000000..5697b69 > > --- /dev/null > > +++ b/data/os/freebsd.org/freebsd-10.4.xml.in > > @@ -0,0 +1,51 @@ > > + > > + > > + > > + freebsd10.4 > > + <_name>FreeBSD 10.4 > > + 10.4 > > + <_vendor>FreeBSD Project > > + freebsd > > + freebsd > > + > > + > > There was some conversation on IRC regarding upgrades VS derives-from, I > don't think derives-from is needed here. Could you please clarify when it's appropriate to use derives-from? PS It looks like these are not pushed yet. Do you want me to send v2 with derives-from dropped or you can amend that before pushing? Thanks, > Apart from this, > Acked-by: Christophe Fergeau > > Christophe Roman Bogorodskiy -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 455 bytes Desc: not available URL: From cfergeau at redhat.com Tue Oct 17 15:08:31 2017 From: cfergeau at redhat.com (Christophe Fergeau) Date: Tue, 17 Oct 2017 17:08:31 +0200 Subject: [Libosinfo] [PATCH osinfo-db] freebsd: add FreeBSD 10.4 info In-Reply-To: <20171017084140.GA2649@kloomba> References: <20171005103841.26129-1-bogorodskiy@gmail.com> <20171016091042.GL29716@natto.ory.fergeau.eu> <20171017084140.GA2649@kloomba> Message-ID: <20171017150831.GH29716@natto.ory.fergeau.eu> Hey, On Tue, Oct 17, 2017 at 01:00:38PM +0400, Roman Bogorodskiy wrote: > Christophe Fergeau wrote: > > > On Thu, Oct 05, 2017 at 02:38:41PM +0400, Roman Bogorodskiy wrote: > > > --- > > > data/os/freebsd.org/freebsd-10.4.xml.in | 51 +++++++++++++++++++++++++++++++++ > > > 1 file changed, 51 insertions(+) > > > create mode 100644 data/os/freebsd.org/freebsd-10.4.xml.in > > > > > > diff --git a/data/os/freebsd.org/freebsd-10.4.xml.in b/data/os/freebsd.org/freebsd-10.4.xml.in > > > new file mode 100644 > > > index 0000000..5697b69 > > > --- /dev/null > > > +++ b/data/os/freebsd.org/freebsd-10.4.xml.in > > > @@ -0,0 +1,51 @@ > > > + > > > + > > > + > > > + freebsd10.4 > > > + <_name>FreeBSD 10.4 > > > + 10.4 > > > + <_vendor>FreeBSD Project > > > + freebsd > > > + freebsd > > > + > > > + > > > > There was some conversation on IRC regarding upgrades VS derives-from, I > > don't think derives-from is needed here. > > Could you please clarify when it's appropriate to use derives-from? > > PS It looks like these are not pushed yet. Do you want me to send v2 > with derives-from dropped or you can amend that before pushing? Yeah, did not push them on purpose waiting for your feedback :) I can amend before pushing, sure. My understanding of derives-from is that it's for special cases like ubuntu being forked off debian, or rhel deriving from fedora, or centos from RHEL. It's not meant to describe regular upgrades from one version to the next. Christophe -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From ptoscano at redhat.com Tue Oct 17 15:23:30 2017 From: ptoscano at redhat.com (Pino Toscano) Date: Tue, 17 Oct 2017 17:23:30 +0200 Subject: [Libosinfo] [libosinfo PATCH 0/3] Improve building stuff of tests Message-ID: <20171017152333.23661-1-ptoscano@redhat.com> Hi, this series makes sure tests can be really disabled (as the configure option intended), and that curl is an optional dependency. Thanks, Pino Toscano (3): build: fix disabling of tests build: make curl optional, and only for tests README: document "check" for tests Makefile.am | 6 +++++- README | 3 ++- configure.ac | 11 +++++++---- mingw-libosinfo.spec.in | 2 -- tests/Makefile.am | 21 +++++++++++++-------- 5 files changed, 27 insertions(+), 16 deletions(-) -- 2.13.6 From ptoscano at redhat.com Tue Oct 17 15:23:31 2017 From: ptoscano at redhat.com (Pino Toscano) Date: Tue, 17 Oct 2017 17:23:31 +0200 Subject: [Libosinfo] [libosinfo PATCH 1/3] build: fix disabling of tests In-Reply-To: <20171017152333.23661-1-ptoscano@redhat.com> References: <20171017152333.23661-1-ptoscano@redhat.com> Message-ID: <20171017152333.23661-2-ptoscano@redhat.com> Actually use the result of the configure switch --enable-tests, enabling or disabling the tests accordingly. Signed-off-by: Pino Toscano --- Makefile.am | 6 +++++- configure.ac | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index c333d26..bc6f7fa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,9 @@ -SUBDIRS = osinfo tests tools docs po examples +SUBDIRS = osinfo tools docs po examples + +if ENABLE_TESTS +SUBDIRS += tests +endif INTLTOOL_FILES = \ intltool-extract.in \ diff --git a/configure.ac b/configure.ac index b3dab09..cba5268 100644 --- a/configure.ac +++ b/configure.ac @@ -63,6 +63,8 @@ if test "x$enable_tests" != "xno" ; then PKG_CHECK_MODULES([CHECK], [check]) fi +AM_CONDITIONAL([ENABLE_TESTS],[test "x$enable_tests" = "xyes"]) + LIBOSINFO_MAJOR_VERSION=`echo $VERSION | awk -F. '{print $1}'` LIBOSINFO_MINOR_VERSION=`echo $VERSION | awk -F. '{print $2}'` LIBOSINFO_MICRO_VERSION=`echo $VERSION | awk -F. '{print $3}'` -- 2.13.6 From ptoscano at redhat.com Tue Oct 17 15:23:32 2017 From: ptoscano at redhat.com (Pino Toscano) Date: Tue, 17 Oct 2017 17:23:32 +0200 Subject: [Libosinfo] [libosinfo PATCH 2/3] build: make curl optional, and only for tests In-Reply-To: <20171017152333.23661-1-ptoscano@redhat.com> References: <20171017152333.23661-1-ptoscano@redhat.com> Message-ID: <20171017152333.23661-3-ptoscano@redhat.com> Look for curl only when the tests are enabled, and as optional build dependency. If curl is missing, then the two network tests are not built. Also, limit the use of curl CFLAGS/LIBS only for the tests that really need it. As side result, it is possible to drop the curl BuildRequires from the mingw spec, as it builds with --enable-tests=no. Signed-off-by: Pino Toscano --- README | 2 +- configure.ac | 9 +++++---- mingw-libosinfo.spec.in | 2 -- tests/Makefile.am | 21 +++++++++++++-------- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/README b/README index 1d1f47a..1a0fa2e 100644 --- a/README +++ b/README @@ -21,12 +21,12 @@ Dependencies - Required: - gobject-2.0 - gio-2.0 - - libcurl - libxml-2.0 - libxslt-1.0 - Optional: - gobject-introspection + - libcurl (for tests only) - Vala (build-time only) Patch submissions diff --git a/configure.ac b/configure.ac index cba5268..99abe94 100644 --- a/configure.ac +++ b/configure.ac @@ -49,10 +49,6 @@ GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MAX_ALLOWED=$GLIB_ENCODED_VERSION" AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) -PKG_CHECK_MODULES([CURL], [libcurl]) -AC_SUBST(CURL_CFLAGS) -AC_SUBST(CURL_LIBS) - GTK_DOC_CHECK([1.10],[--flavour no-tmpl]) AC_ARG_ENABLE([tests], @@ -60,7 +56,12 @@ AC_ARG_ENABLE([tests], [], [enable_tests=yes]) if test "x$enable_tests" != "xno" ; then + have_curl=no PKG_CHECK_MODULES([CHECK], [check]) + PKG_CHECK_MODULES([CURL], [libcurl], [have_curl=yes], [:]) + AC_SUBST(CURL_CFLAGS) + AC_SUBST(CURL_LIBS) + AM_CONDITIONAL([HAVE_CURL],[test "x$have_curl" = "xyes"]) fi AM_CONDITIONAL([ENABLE_TESTS],[test "x$enable_tests" = "xyes"]) diff --git a/mingw-libosinfo.spec.in b/mingw-libosinfo.spec.in index 0653282..526d65a 100644 --- a/mingw-libosinfo.spec.in +++ b/mingw-libosinfo.spec.in @@ -26,8 +26,6 @@ BuildRequires: mingw32-libxml2 BuildRequires: mingw64-libxml2 BuildRequires: mingw32-libxslt BuildRequires: mingw64-libxslt -BuildRequires: mingw32-libcurl -BuildRequires: mingw64-libcurl BuildRequires: pkgconfig diff --git a/tests/Makefile.am b/tests/Makefile.am index e3df06b..9315e04 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,16 +16,20 @@ check_PROGRAMS = \ test-db \ test-loader \ test-isodetect \ - test-mediauris \ - test-treeuris \ test-install-script \ $(NULL) +if HAVE_CURL +check_PROGRAMS += \ + test-mediauris \ + test-treeuris \ + $(NULL) +endif + COMMON_LDADD = \ $(COVERAGE_LDFLAGS) \ $(GLIB_LIBS) \ $(GOBJECT_LIBS) \ - $(CURL_LIBS) \ $(CHECK_LIBS) \ ../osinfo/libosinfo-1.0.la COMMON_CFLAGS = \ @@ -33,7 +37,6 @@ COMMON_CFLAGS = \ $(COVERAGE_CFLAGS) \ $(GLIB_CFLAGS) \ $(GOBJECT_CFLAGS) \ - $(CURL_CFLAGS) \ -I$(top_srcdir) \ -DSRCDIR="\"$(abs_top_srcdir)\"" \ -DBUILDDIR="\"$(abs_top_builddir)\"" \ @@ -95,13 +98,15 @@ test_isodetect_LDADD = $(COMMON_LDADD) test_isodetect_CFLAGS = $(COMMON_CFLAGS) test_isodetect_SOURCES = test-isodetect.c -test_mediauris_LDADD = $(COMMON_LDADD) -test_mediauris_CFLAGS = $(COMMON_CFLAGS) +if HAVE_CURL +test_mediauris_LDADD = $(COMMON_LDADD) $(CURL_LIBS) +test_mediauris_CFLAGS = $(COMMON_CFLAGS) $(CURL_CFLAGS) test_mediauris_SOURCES = test-mediauris.c -test_treeuris_LDADD = $(COMMON_LDADD) -test_treeuris_CFLAGS = $(COMMON_CFLAGS) +test_treeuris_LDADD = $(COMMON_LDADD) $(CURL_LIBS) +test_treeuris_CFLAGS = $(COMMON_CFLAGS) $(CURL_CFLAGS) test_treeuris_SOURCES = test-treeuris.c +endif test_install_script_LDADD = $(COMMON_LDADD) test_install_script_CFLAGS = $(COMMON_CFLAGS) -- 2.13.6 From ptoscano at redhat.com Tue Oct 17 15:23:33 2017 From: ptoscano at redhat.com (Pino Toscano) Date: Tue, 17 Oct 2017 17:23:33 +0200 Subject: [Libosinfo] [libosinfo PATCH 3/3] README: document "check" for tests In-Reply-To: <20171017152333.23661-1-ptoscano@redhat.com> References: <20171017152333.23661-1-ptoscano@redhat.com> Message-ID: <20171017152333.23661-4-ptoscano@redhat.com> "check" is required when building the tests (which are enabled by default), so document it. Signed-off-by: Pino Toscano --- README | 1 + 1 file changed, 1 insertion(+) diff --git a/README b/README index 1a0fa2e..11063ca 100644 --- a/README +++ b/README @@ -19,6 +19,7 @@ Dependencies ============ - Required: + - check (for tests only) - gobject-2.0 - gio-2.0 - libxml-2.0 -- 2.13.6 From berrange at redhat.com Tue Oct 17 15:37:53 2017 From: berrange at redhat.com (Daniel P. Berrange) Date: Tue, 17 Oct 2017 16:37:53 +0100 Subject: [Libosinfo] [libosinfo PATCH 1/3] build: fix disabling of tests In-Reply-To: <20171017152333.23661-2-ptoscano@redhat.com> References: <20171017152333.23661-1-ptoscano@redhat.com> <20171017152333.23661-2-ptoscano@redhat.com> Message-ID: <20171017153753.GD31897@redhat.com> On Tue, Oct 17, 2017 at 05:23:31PM +0200, Pino Toscano wrote: > Actually use the result of the configure switch --enable-tests, enabling > or disabling the tests accordingly. > > Signed-off-by: Pino Toscano > --- > Makefile.am | 6 +++++- > configure.ac | 2 ++ > 2 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/Makefile.am b/Makefile.am > index c333d26..bc6f7fa 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -1,5 +1,9 @@ > > -SUBDIRS = osinfo tests tools docs po examples > +SUBDIRS = osinfo tools docs po examples > + > +if ENABLE_TESTS > +SUBDIRS += tests > +endif > > INTLTOOL_FILES = \ > intltool-extract.in \ > diff --git a/configure.ac b/configure.ac > index b3dab09..cba5268 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -63,6 +63,8 @@ if test "x$enable_tests" != "xno" ; then > PKG_CHECK_MODULES([CHECK], [check]) > fi > > +AM_CONDITIONAL([ENABLE_TESTS],[test "x$enable_tests" = "xyes"]) > + > LIBOSINFO_MAJOR_VERSION=`echo $VERSION | awk -F. '{print $1}'` > LIBOSINFO_MINOR_VERSION=`echo $VERSION | awk -F. '{print $2}'` > LIBOSINFO_MICRO_VERSION=`echo $VERSION | awk -F. '{print $3}'` Reviewed-by: Daniel P. Berrange 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 :| From berrange at redhat.com Tue Oct 17 15:39:38 2017 From: berrange at redhat.com (Daniel P. Berrange) Date: Tue, 17 Oct 2017 16:39:38 +0100 Subject: [Libosinfo] [libosinfo PATCH 2/3] build: make curl optional, and only for tests In-Reply-To: <20171017152333.23661-3-ptoscano@redhat.com> References: <20171017152333.23661-1-ptoscano@redhat.com> <20171017152333.23661-3-ptoscano@redhat.com> Message-ID: <20171017153938.GE31897@redhat.com> On Tue, Oct 17, 2017 at 05:23:32PM +0200, Pino Toscano wrote: > Look for curl only when the tests are enabled, and as optional build > dependency. If curl is missing, then the two network tests are not > built. Also, limit the use of curl CFLAGS/LIBS only for the tests that > really need it. > > As side result, it is possible to drop the curl BuildRequires from the > mingw spec, as it builds with --enable-tests=no. > > Signed-off-by: Pino Toscano Reviewed-by: Daniel P. Berrange If someone feels motivated it would be nice to try and convert our tests to use GIO for networking, if possible, so we don't need extra libraries. Also I wonder we want an explicit --disable-network-tests to disable just the tests which involve networking, for sake of build envs which don't allow networking. 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 :| From berrange at redhat.com Tue Oct 17 15:40:19 2017 From: berrange at redhat.com (Daniel P. Berrange) Date: Tue, 17 Oct 2017 16:40:19 +0100 Subject: [Libosinfo] [libosinfo PATCH 3/3] README: document "check" for tests In-Reply-To: <20171017152333.23661-4-ptoscano@redhat.com> References: <20171017152333.23661-1-ptoscano@redhat.com> <20171017152333.23661-4-ptoscano@redhat.com> Message-ID: <20171017154019.GF31897@redhat.com> On Tue, Oct 17, 2017 at 05:23:33PM +0200, Pino Toscano wrote: > "check" is required when building the tests (which are enabled by > default), so document it. > > Signed-off-by: Pino Toscano > --- > README | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/README b/README > index 1a0fa2e..11063ca 100644 > --- a/README > +++ b/README > @@ -19,6 +19,7 @@ Dependencies > ============ > > - Required: > + - check (for tests only) > - gobject-2.0 > - gio-2.0 > - libxml-2.0 Reviewed-by: Daniel P. Berrange Another future thing we should do is rewrite tests to use glib's native unit test infrastructure and ditch 'check' entirely. 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 :| From bogorodskiy at gmail.com Wed Oct 18 06:05:36 2017 From: bogorodskiy at gmail.com (Roman Bogorodskiy) Date: Wed, 18 Oct 2017 10:05:36 +0400 Subject: [Libosinfo] [PATCH osinfo-db] freebsd: add FreeBSD 10.4 info In-Reply-To: <20171017150831.GH29716@natto.ory.fergeau.eu> References: <20171005103841.26129-1-bogorodskiy@gmail.com> <20171016091042.GL29716@natto.ory.fergeau.eu> <20171017084140.GA2649@kloomba> <20171017150831.GH29716@natto.ory.fergeau.eu> Message-ID: <20171018060534.GA20932@dev.san.ru> Christophe Fergeau wrote: > Hey, > > On Tue, Oct 17, 2017 at 01:00:38PM +0400, Roman Bogorodskiy wrote: > > Christophe Fergeau wrote: > > > > > On Thu, Oct 05, 2017 at 02:38:41PM +0400, Roman Bogorodskiy wrote: > > > > --- > > > > data/os/freebsd.org/freebsd-10.4.xml.in | 51 +++++++++++++++++++++++++++++++++ > > > > 1 file changed, 51 insertions(+) > > > > create mode 100644 data/os/freebsd.org/freebsd-10.4.xml.in > > > > > > > > diff --git a/data/os/freebsd.org/freebsd-10.4.xml.in b/data/os/freebsd.org/freebsd-10.4.xml.in > > > > new file mode 100644 > > > > index 0000000..5697b69 > > > > --- /dev/null > > > > +++ b/data/os/freebsd.org/freebsd-10.4.xml.in > > > > @@ -0,0 +1,51 @@ > > > > + > > > > + > > > > + > > > > + freebsd10.4 > > > > + <_name>FreeBSD 10.4 > > > > + 10.4 > > > > + <_vendor>FreeBSD Project > > > > + freebsd > > > > + freebsd > > > > + > > > > + > > > > > > There was some conversation on IRC regarding upgrades VS derives-from, I > > > don't think derives-from is needed here. > > > > Could you please clarify when it's appropriate to use derives-from? > > > > PS It looks like these are not pushed yet. Do you want me to send v2 > > with derives-from dropped or you can amend that before pushing? > > Yeah, did not push them on purpose waiting for your feedback :) I can > amend before pushing, sure. My understanding of derives-from is that > it's for special cases like ubuntu being forked off debian, or rhel > deriving from fedora, or centos from RHEL. It's not meant to describe > regular upgrades from one version to the next. > > Christophe This sounds reasonable to me. Should we also drop 'derives-from' from the previous releases' entries? Also, thinking about it, I'm not sure about one thing regarding 'upgrades': FreeBSD supports multiple major versions in parallel. For example it could be this way: 10.3 -> 10.4 | 11.0 -> 11.1 -> ... -> 11.X So 10.4 will become a dead end because there'll be no entries that refer it in (e.g. 11.X will refer 11.(X-1)). What's the right way to handle that? Thanks, Roman Bogorodskiy -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: not available URL: From cfergeau at redhat.com Wed Oct 18 06:51:59 2017 From: cfergeau at redhat.com (Christophe Fergeau) Date: Wed, 18 Oct 2017 08:51:59 +0200 Subject: [Libosinfo] [libosinfo PATCH 2/3] build: make curl optional, and only for tests In-Reply-To: <20171017153938.GE31897@redhat.com> References: <20171017152333.23661-1-ptoscano@redhat.com> <20171017152333.23661-3-ptoscano@redhat.com> <20171017153938.GE31897@redhat.com> Message-ID: <20171018065159.GL29716@natto.ory.fergeau.eu> Hey, On Tue, Oct 17, 2017 at 04:39:38PM +0100, Daniel P. Berrange wrote: > On Tue, Oct 17, 2017 at 05:23:32PM +0200, Pino Toscano wrote: > > Look for curl only when the tests are enabled, and as optional build > > dependency. If curl is missing, then the two network tests are not > > built. Also, limit the use of curl CFLAGS/LIBS only for the tests that > > really need it. > > > > As side result, it is possible to drop the curl BuildRequires from the > > mingw spec, as it builds with --enable-tests=no. > > > > Signed-off-by: Pino Toscano > > Reviewed-by: Daniel P. Berrange > > > If someone feels motivated it would be nice to try and convert our > tests to use GIO for networking, if possible, so we don't need extra > libraries. The tests used to be using libsoup (which also counts as an extra library), this was switched to curl in b61be04 because the former does not support ftp. I was able to get a FTP FreeBSD ISO with gio mount ftp://ftp.freebsd.org/ gio copy ftp://ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/11.0/FreeBSD-11.0-RELEASE-amd64-dvd1.iso . gio mount -u ftp://ftp.freebsd.org/ so it should indeed be possible to cook up something with GIO (provided the needed GVFS backends are installed). > Also I wonder we want an explicit --disable-network-tests to disable > just the tests which involve networking, for sake of build envs which > don't allow networking. By default, the tests which need networking are only run if LIBOSINFO_NETWORK_TESTS is in the environment, --disable-network-tests could be useful in making this more visible indeed, though the network tests are so long that they'd be disabled most of the time. Christophe -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From cfergeau at redhat.com Wed Oct 18 07:21:15 2017 From: cfergeau at redhat.com (Christophe Fergeau) Date: Wed, 18 Oct 2017 09:21:15 +0200 Subject: [Libosinfo] [PATCH osinfo-db] freebsd: add FreeBSD 10.4 info In-Reply-To: <20171018060534.GA20932@dev.san.ru> References: <20171005103841.26129-1-bogorodskiy@gmail.com> <20171016091042.GL29716@natto.ory.fergeau.eu> <20171017084140.GA2649@kloomba> <20171017150831.GH29716@natto.ory.fergeau.eu> <20171018060534.GA20932@dev.san.ru> Message-ID: <20171018072115.GO29716@natto.ory.fergeau.eu> On Wed, Oct 18, 2017 at 10:05:36AM +0400, Roman Bogorodskiy wrote: > This sounds reasonable to me. Should we also drop 'derives-from' from > the previous releases' entries? Hmm, git grep'ping, derives-from is used all over the place ;) One thing I don't know for sure is whether it should be used for major upgrades (RHEL 6 to RHEL 7, or Fedora 21 to 22). > Also, thinking about it, I'm not sure about one thing regarding > 'upgrades': FreeBSD supports multiple major versions in parallel. > > For example it could be this way: > > 10.3 -> 10.4 > | > 11.0 -> 11.1 -> ... -> 11.X > > So 10.4 will become a dead end because there'll be no entries that > refer it in (e.g. 11.X will refer 11.(X-1)). What's the right > way to handle that? I don't know how much it is documented that 11.0 upgrades 10.3 and not 10.4? Is it just this way because we added to the database first 10.3, then 11.0, and finally 10.4? Or are there stronger requirements? Most of the times, things are this way in the database because of the timing of additions, if 11.0 was added later than 10.4, 11.0 would be marked as upgrading 10.4 rather than 10.3. So it might make sense to update the 11.0 entry to refer to 10.4 if needed. However, I don't think a lot of things are looking into these upgrades/derives links. Maybe libosinfo follows them for device support( I always forget ;) And it probably does not matter too much to have dead ends. Christophe -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From bogorodskiy at gmail.com Thu Oct 19 04:31:05 2017 From: bogorodskiy at gmail.com (Roman Bogorodskiy) Date: Thu, 19 Oct 2017 08:31:05 +0400 Subject: [Libosinfo] [PATCH osinfo-db] freebsd: add FreeBSD 10.4 info In-Reply-To: <20171018072115.GO29716@natto.ory.fergeau.eu> References: <20171005103841.26129-1-bogorodskiy@gmail.com> <20171016091042.GL29716@natto.ory.fergeau.eu> <20171017084140.GA2649@kloomba> <20171017150831.GH29716@natto.ory.fergeau.eu> <20171018060534.GA20932@dev.san.ru> <20171018072115.GO29716@natto.ory.fergeau.eu> Message-ID: <20171019043103.GB20932@dev.san.ru> Christophe Fergeau wrote: > On Wed, Oct 18, 2017 at 10:05:36AM +0400, Roman Bogorodskiy wrote: > > This sounds reasonable to me. Should we also drop 'derives-from' from > > the previous releases' entries? > > Hmm, git grep'ping, derives-from is used all over the place ;) One thing > I don't know for sure is whether it should be used for major upgrades > (RHEL 6 to RHEL 7, or Fedora 21 to 22). > > > Also, thinking about it, I'm not sure about one thing regarding > > 'upgrades': FreeBSD supports multiple major versions in parallel. > > > > For example it could be this way: > > > > 10.3 -> 10.4 > > | > > 11.0 -> 11.1 -> ... -> 11.X > > > > So 10.4 will become a dead end because there'll be no entries that > > refer it in (e.g. 11.X will refer 11.(X-1)). What's the right > > way to handle that? > > I don't know how much it is documented that 11.0 upgrades 10.3 and not > 10.4? Is it just this way because we added to the database first 10.3, > then 11.0, and finally 10.4? Or are there stronger requirements? Yeah, it's this way because 11.0 goes before 10.4. > Most of the times, things are this way in the database because of the > timing of additions, if 11.0 was added later than 10.4, 11.0 would be > marked as upgrading 10.4 rather than 10.3. > So it might make sense to update the 11.0 entry to refer to 10.4 if > needed. However, I don't think a lot of things are looking into these > upgrades/derives links. Maybe libosinfo follows them for device support( > I always forget ;) And it probably does not matter too much to have dead > ends. Ok, so let it be as it is now. Roman Bogorodskiy -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: not available URL: From ptoscano at redhat.com Thu Oct 19 11:31:00 2017 From: ptoscano at redhat.com (Pino Toscano) Date: Thu, 19 Oct 2017 13:31:00 +0200 Subject: [Libosinfo] [libosinfo PATCH 3/3] README: document "check" for tests In-Reply-To: <20171017154019.GF31897@redhat.com> References: <20171017152333.23661-1-ptoscano@redhat.com> <20171017152333.23661-4-ptoscano@redhat.com> <20171017154019.GF31897@redhat.com> Message-ID: <1786185.EJ3VUazqZa@thyrus.usersys.redhat.com> On Tuesday, 17 October 2017 17:40:19 CEST Daniel P. Berrange wrote: > On Tue, Oct 17, 2017 at 05:23:33PM +0200, Pino Toscano wrote: > > "check" is required when building the tests (which are enabled by > > default), so document it. > > > > Signed-off-by: Pino Toscano > > --- > > README | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/README b/README > > index 1a0fa2e..11063ca 100644 > > --- a/README > > +++ b/README > > @@ -19,6 +19,7 @@ Dependencies > > ============ > > > > - Required: > > + - check (for tests only) > > - gobject-2.0 > > - gio-2.0 > > - libxml-2.0 > > Reviewed-by: Daniel P. Berrange > > > Another future thing we should do is rewrite tests to use glib's native > unit test infrastructure and ditch 'check' entirely. Actually I withdraw this patch, since I'm going to send a conversion of the tests to the GLib test framework. Thanks, -- Pino Toscano -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part. URL: From ptoscano at redhat.com Thu Oct 19 13:14:24 2017 From: ptoscano at redhat.com (Pino Toscano) Date: Thu, 19 Oct 2017 15:14:24 +0200 Subject: [Libosinfo] [libosinfo PATCH] tests: convert from check to the GLib testing framework Message-ID: <20171019131424.21880-1-ptoscano@redhat.com> GLib has shipped a testing framework for many years already, so we can make use of it, replacing the external "check". The conversion only switches framework without changing the structure of the tests, making use of the more appropriate assertion in the various places. Signed-off-by: Pino Toscano --- configure.ac | 1 - libosinfo.spec.in | 1 - tests/Makefile.am | 3 +- tests/test-db.c | 165 +++++++++++++++++-------------------- tests/test-device.c | 33 ++------ tests/test-devicelist.c | 77 +++++++---------- tests/test-entity.c | 195 ++++++++++++++++++++------------------------ tests/test-filter.c | 111 +++++++++++-------------- tests/test-install-script.c | 92 ++++++++------------- tests/test-isodetect.c | 138 ++++++++++++++----------------- tests/test-list.c | 145 +++++++++++++++----------------- tests/test-loader.c | 33 ++------ tests/test-mediauris.c | 44 ++++------ tests/test-os.c | 122 ++++++++++++--------------- tests/test-oslist.c | 77 +++++++---------- tests/test-platform.c | 61 ++++++-------- tests/test-platformlist.c | 77 +++++++---------- tests/test-product.c | 100 ++++++++++------------- tests/test-productfilter.c | 143 +++++++++++++++----------------- tests/test-treeuris.c | 44 ++++------ 20 files changed, 694 insertions(+), 968 deletions(-) diff --git a/configure.ac b/configure.ac index 99abe94..d834c89 100644 --- a/configure.ac +++ b/configure.ac @@ -57,7 +57,6 @@ AC_ARG_ENABLE([tests], if test "x$enable_tests" != "xno" ; then have_curl=no - PKG_CHECK_MODULES([CHECK], [check]) PKG_CHECK_MODULES([CURL], [libcurl], [have_curl=yes], [:]) AC_SUBST(CURL_CFLAGS) AC_SUBST(CURL_LIBS) diff --git a/libosinfo.spec.in b/libosinfo.spec.in index 5a5e6f8..f3e3690 100644 --- a/libosinfo.spec.in +++ b/libosinfo.spec.in @@ -11,7 +11,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) URL: https://libosinfo.org/ BuildRequires: intltool BuildRequires: glib2-devel -BuildRequires: check-devel BuildRequires: libxml2-devel >= 2.6.0 BuildRequires: libxslt-devel >= 1.0.0 BuildRequires: vala diff --git a/tests/Makefile.am b/tests/Makefile.am index 9315e04..7566d3c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -30,7 +30,6 @@ COMMON_LDADD = \ $(COVERAGE_LDFLAGS) \ $(GLIB_LIBS) \ $(GOBJECT_LIBS) \ - $(CHECK_LIBS) \ ../osinfo/libosinfo-1.0.la COMMON_CFLAGS = \ $(WARN_CFLAGS) \ @@ -40,7 +39,7 @@ COMMON_CFLAGS = \ -I$(top_srcdir) \ -DSRCDIR="\"$(abs_top_srcdir)\"" \ -DBUILDDIR="\"$(abs_top_builddir)\"" \ - $(CHECK_CFLAGS) + $(NULL) test_entity_LDADD = $(COMMON_LDADD) test_entity_CFLAGS = $(COMMON_CFLAGS) diff --git a/tests/test-db.c b/tests/test-db.c index 31e80d1..ac0a529 100644 --- a/tests/test-db.c +++ b/tests/test-db.c @@ -21,22 +21,21 @@ #include -#include #include -#include -START_TEST(test_basic) +static void +test_basic(void) { OsinfoDb *db = osinfo_db_new(); - fail_unless(OSINFO_IS_DB(db), "Db is not a DB"); + g_assert_true(OSINFO_IS_DB(db)); g_object_unref(db); } -END_TEST -START_TEST(test_device) +static void +test_device(void) { OsinfoDb *db = osinfo_db_new(); OsinfoDevice *dev1 = osinfo_device_new("dev1"); @@ -48,24 +47,24 @@ START_TEST(test_device) osinfo_db_add_device(db, dev3); OsinfoDeviceList *list = osinfo_db_get_device_list(db); - fail_unless(OSINFO_ENTITY(dev1) == osinfo_list_get_nth(OSINFO_LIST(list), 0), "Dev 1 is missing"); - fail_unless(OSINFO_ENTITY(dev2) == osinfo_list_get_nth(OSINFO_LIST(list), 1), "Dev 2 is missing"); - fail_unless(OSINFO_ENTITY(dev3) == osinfo_list_get_nth(OSINFO_LIST(list), 2), "Dev 3 is missing"); + g_assert_true(OSINFO_ENTITY(dev1) == osinfo_list_get_nth(OSINFO_LIST(list), 0)); + g_assert_true(OSINFO_ENTITY(dev2) == osinfo_list_get_nth(OSINFO_LIST(list), 1)); + g_assert_true(OSINFO_ENTITY(dev3) == osinfo_list_get_nth(OSINFO_LIST(list), 2)); g_object_unref(list); OsinfoDevice *dev = osinfo_db_get_device(db, "dev2"); - fail_unless(dev != NULL, "Device is NULL"); - fail_unless(dev == dev2, "Device was not dev2"); + g_assert_nonnull(dev); + g_assert_true(dev == dev2); g_object_unref(dev1); g_object_unref(dev2); g_object_unref(dev3); g_object_unref(db); } -END_TEST -START_TEST(test_platform) +static void +test_platform(void) { OsinfoDb *db = osinfo_db_new(); OsinfoPlatform *hv1 = osinfo_platform_new("hv1"); @@ -77,24 +76,24 @@ START_TEST(test_platform) osinfo_db_add_platform(db, hv3); OsinfoPlatformList *list = osinfo_db_get_platform_list(db); - fail_unless(OSINFO_ENTITY(hv1) == osinfo_list_get_nth(OSINFO_LIST(list), 0), "Hv 1 is missing"); - fail_unless(OSINFO_ENTITY(hv2) == osinfo_list_get_nth(OSINFO_LIST(list), 1), "Hv 2 is missing"); - fail_unless(OSINFO_ENTITY(hv3) == osinfo_list_get_nth(OSINFO_LIST(list), 2), "Hv 3 is missing"); + g_assert_true(OSINFO_ENTITY(hv1) == osinfo_list_get_nth(OSINFO_LIST(list), 0)); + g_assert_true(OSINFO_ENTITY(hv2) == osinfo_list_get_nth(OSINFO_LIST(list), 1)); + g_assert_true(OSINFO_ENTITY(hv3) == osinfo_list_get_nth(OSINFO_LIST(list), 2)); g_object_unref(list); OsinfoPlatform *hv = osinfo_db_get_platform(db, "hv2"); - fail_unless(hv != NULL, "Platform is NULL"); - fail_unless(hv == hv2, "Platform was not hv2"); + g_assert_nonnull(hv); + g_assert_true(hv == hv2); g_object_unref(hv1); g_object_unref(hv2); g_object_unref(hv3); g_object_unref(db); } -END_TEST -START_TEST(test_os) +static void +test_os(void) { OsinfoDb *db = osinfo_db_new(); OsinfoOs *os1 = osinfo_os_new("os1"); @@ -106,25 +105,25 @@ START_TEST(test_os) osinfo_db_add_os(db, os3); OsinfoOsList *list = osinfo_db_get_os_list(db); - fail_unless(OSINFO_ENTITY(os1) == osinfo_list_get_nth(OSINFO_LIST(list), 0), "Os 1 is missing"); - fail_unless(OSINFO_ENTITY(os2) == osinfo_list_get_nth(OSINFO_LIST(list), 1), "Os 2 is missing"); - fail_unless(OSINFO_ENTITY(os3) == osinfo_list_get_nth(OSINFO_LIST(list), 2), "Os 3 is missing"); + g_assert_true(OSINFO_ENTITY(os1) == osinfo_list_get_nth(OSINFO_LIST(list), 0)); + g_assert_true(OSINFO_ENTITY(os2) == osinfo_list_get_nth(OSINFO_LIST(list), 1)); + g_assert_true(OSINFO_ENTITY(os3) == osinfo_list_get_nth(OSINFO_LIST(list), 2)); g_object_unref(list); OsinfoOs *os = osinfo_db_get_os(db, "os2"); - fail_unless(os != NULL, "Os is NULL"); - fail_unless(os == os2, "Os was not os2"); + g_assert_nonnull(os); + g_assert_true(os == os2); g_object_unref(os1); g_object_unref(os2); g_object_unref(os3); g_object_unref(db); } -END_TEST -START_TEST(test_prop_device) +static void +test_prop_device(void) { OsinfoDb *db = osinfo_db_new(); OsinfoDevice *dev1 = osinfo_device_new("dev1"); @@ -161,11 +160,11 @@ START_TEST(test_prop_device) hasBad = TRUE; tmp = tmp->next; } - fail_unless(hasNetwork, "Missing network"); - fail_unless(hasAudio, "Missing audio"); - fail_unless(hasInput, "Missing input"); - fail_unless(hasDisplay, "Missing display"); - fail_unless(!hasBad, "Unexpected property"); + g_assert_true(hasNetwork); + g_assert_true(hasAudio); + g_assert_true(hasInput); + g_assert_true(hasDisplay); + g_assert_false(hasBad); g_list_free(uniq); @@ -174,10 +173,10 @@ START_TEST(test_prop_device) g_object_unref(dev3); g_object_unref(db); } -END_TEST -START_TEST(test_prop_platform) +static void +test_prop_platform(void) { OsinfoDb *db = osinfo_db_new(); OsinfoPlatform *hv1 = osinfo_platform_new("hv1"); @@ -211,10 +210,10 @@ START_TEST(test_prop_platform) hasBad = TRUE; tmp = tmp->next; } - fail_unless(hasAcme, "Missing acme"); - fail_unless(hasFrog, "Missing frog"); - fail_unless(hasDog, "Missing dog"); - fail_unless(!hasBad, "Unexpected property"); + g_assert_true(hasAcme); + g_assert_true(hasFrog); + g_assert_true(hasDog); + g_assert_false(hasBad); g_list_free(uniq); @@ -223,10 +222,10 @@ START_TEST(test_prop_platform) g_object_unref(hv3); g_object_unref(db); } -END_TEST -START_TEST(test_prop_os) +static void +test_prop_os(void) { OsinfoDb *db = osinfo_db_new(); OsinfoOs *os1 = osinfo_os_new("os1"); @@ -260,10 +259,10 @@ START_TEST(test_prop_os) hasBad = TRUE; tmp = tmp->next; } - fail_unless(hasAcme, "Missing acme"); - fail_unless(hasFrog, "Missing frog"); - fail_unless(hasDog, "Missing dog"); - fail_unless(!hasBad, "Unexpected property"); + g_assert_true(hasAcme); + g_assert_true(hasFrog); + g_assert_true(hasDog); + g_assert_false(hasBad); g_list_free(uniq); @@ -272,11 +271,11 @@ START_TEST(test_prop_os) g_object_unref(os3); g_object_unref(db); } -END_TEST -START_TEST(test_rel_os) +static void +test_rel_os(void) { OsinfoDb *db = osinfo_db_new(); OsinfoOs *os1 = osinfo_os_new("os1"); @@ -321,12 +320,12 @@ START_TEST(test_rel_os) hasBad = TRUE; } - fail_unless(!hasOs1, "Unexpected OS 1"); - fail_unless(hasOs2, "Missing OS 2"); - fail_unless(hasOs3, "Missing OS 3"); - fail_unless(!hasOs4, "Unexpected OS 4"); - fail_unless(!hasOs5, "Unexpected OS 5"); - fail_unless(!hasBad, "Unexpected property"); + g_assert_false(hasOs1); + g_assert_true(hasOs2); + g_assert_true(hasOs3); + g_assert_false(hasOs4); + g_assert_false(hasOs5); + g_assert_false(hasBad); g_object_unref(sublist); @@ -349,12 +348,12 @@ START_TEST(test_rel_os) hasBad = TRUE; } - fail_unless(!hasOs1, "Unexpected OS 1"); - fail_unless(!hasOs2, "Unexpected OS 2"); - fail_unless(!hasOs3, "Unexpected OS 3"); - fail_unless(!hasOs4, "Unexpected OS 4"); - fail_unless(hasOs5, "Missing OS 5"); - fail_unless(!hasBad, "Unexpected property"); + g_assert_false(hasOs1); + g_assert_false(hasOs2); + g_assert_false(hasOs3); + g_assert_false(hasOs4); + g_assert_true(hasOs5); + g_assert_false(hasBad); g_object_unref(sublist); @@ -377,12 +376,12 @@ START_TEST(test_rel_os) hasBad = TRUE; } - fail_unless(!hasOs1, "Unexpected OS 1"); - fail_unless(!hasOs2, "Unexpected OS 2"); - fail_unless(!hasOs3, "Unexpected OS 3"); - fail_unless(hasOs4, "Missing OS 4"); - fail_unless(!hasOs5, "Unexpected OS 5"); - fail_unless(!hasBad, "Unexpected property"); + g_assert_false(hasOs1); + g_assert_false(hasOs2); + g_assert_false(hasOs3); + g_assert_true(hasOs4); + g_assert_false(hasOs5); + g_assert_false(hasBad); g_object_unref(sublist); @@ -394,33 +393,23 @@ START_TEST(test_rel_os) g_object_unref(os5); g_object_unref(db); } -END_TEST -static Suite * -list_suite(void) +int +main(int argc, char *argv[]) { - Suite *s = suite_create("List"); - TCase *tc = tcase_create("Core"); - tcase_add_test(tc, test_basic); - tcase_add_test(tc, test_device); - tcase_add_test(tc, test_platform); - tcase_add_test(tc, test_os); - tcase_add_test(tc, test_prop_device); - tcase_add_test(tc, test_prop_platform); - tcase_add_test(tc, test_prop_os); - tcase_add_test(tc, test_rel_os); - suite_add_tcase(s, tc); - return s; -} + g_test_init(&argc, &argv, NULL); -int main(void) -{ - int number_failed; - Suite *s = list_suite(); - SRunner *sr = srunner_create(s); + g_test_add_func("/db/basic", test_basic); + g_test_add_func("/db/device", test_device); + g_test_add_func("/db/platform", test_platform); + g_test_add_func("/db/os", test_os); + g_test_add_func("/db/prop_device", test_prop_device); + g_test_add_func("/db/prop_platform", test_prop_platform); + g_test_add_func("/db/prop_os", test_prop_os); + g_test_add_func("/db/rel_os", test_rel_os); /* Make sure we catch unexpected g_warning() */ g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); @@ -437,11 +426,7 @@ int main(void) osinfo_oslist_get_type(); osinfo_filter_get_type(); - srunner_run_all(sr, CK_ENV); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); - - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return g_test_run(); } /* * Local variables: diff --git a/tests/test-device.c b/tests/test-device.c index c7b2a82..f14eeba 100644 --- a/tests/test-device.c +++ b/tests/test-device.c @@ -21,39 +21,28 @@ #include -#include #include -#include -START_TEST(test_basic) +static void +test_basic(void) { OsinfoDevice *device = osinfo_device_new("e1000"); - fail_unless(OSINFO_IS_DEVICE(device), "Device is a device object"); - fail_unless(g_strcmp0(osinfo_entity_get_id(OSINFO_ENTITY(device)), "e1000") == 0, "Device ID was e1000"); + g_assert_true(OSINFO_IS_DEVICE(device)); + g_assert_cmpstr(osinfo_entity_get_id(OSINFO_ENTITY(device)), ==, "e1000"); g_object_unref(device); } -END_TEST -static Suite * -device_suite(void) +int +main(int argc, char *argv[]) { - Suite *s = suite_create("Device"); - TCase *tc = tcase_create("Core"); - tcase_add_test(tc, test_basic); - suite_add_tcase(s, tc); - return s; -} + g_test_init(&argc, &argv, NULL); -int main(void) -{ - int number_failed; - Suite *s = device_suite(); - SRunner *sr = srunner_create(s); + g_test_add_func("/device/basic", test_basic); /* Make sure we catch unexpected g_warning() */ g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); @@ -61,11 +50,7 @@ int main(void) /* Upfront so we don't confuse valgrind */ osinfo_device_get_type(); - srunner_run_all(sr, CK_ENV); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); - - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return g_test_run(); } /* * Local variables: diff --git a/tests/test-devicelist.c b/tests/test-devicelist.c index b83d6ca..cd69793 100644 --- a/tests/test-devicelist.c +++ b/tests/test-devicelist.c @@ -21,12 +21,11 @@ #include -#include #include -#include -START_TEST(test_union) +static void +test_union(void) { OsinfoDeviceList *list1 = osinfo_devicelist_new(); OsinfoDeviceList *list2 = osinfo_devicelist_new(); @@ -45,7 +44,7 @@ START_TEST(test_union) list3 = OSINFO_DEVICELIST(osinfo_list_new_union(OSINFO_LIST(list1), OSINFO_LIST(list2))); - fail_unless(osinfo_list_get_length(OSINFO_LIST(list3)) == 4, "List did not have 4 elements"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(list3)), ==, 4); gboolean has1 = FALSE; gboolean has2 = FALSE; @@ -66,11 +65,11 @@ START_TEST(test_union) else hasBad = TRUE; } - fail_unless(has1, "List was missing entity 1"); - fail_unless(has2, "List was missing entity 2"); - fail_unless(has3, "List was missing entity 3"); - fail_unless(has4, "List was missing entity 4"); - fail_unless(!hasBad, "List had unexpected entity"); + g_assert_true(has1); + g_assert_true(has2); + g_assert_true(has3); + g_assert_true(has4); + g_assert_false(hasBad); g_object_unref(ent1); g_object_unref(ent2); @@ -80,10 +79,10 @@ START_TEST(test_union) g_object_unref(list2); g_object_unref(list3); } -END_TEST -START_TEST(test_intersect) +static void +test_intersect(void) { OsinfoDeviceList *list1 = osinfo_devicelist_new(); OsinfoDeviceList *list2 = osinfo_devicelist_new(); @@ -104,7 +103,7 @@ START_TEST(test_intersect) list3 = OSINFO_DEVICELIST(osinfo_list_new_intersection(OSINFO_LIST(list1), OSINFO_LIST(list2))); - fail_unless(osinfo_list_get_length(OSINFO_LIST(list3)) == 2, "List did not have 2 elements"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(list3)), ==, 2); gboolean has1 = FALSE; gboolean has2 = FALSE; @@ -125,11 +124,11 @@ START_TEST(test_intersect) else hasBad = TRUE; } - fail_unless(has1, "List was missing entity 1"); - fail_unless(!has2, "List had unexpected entity 2"); - fail_unless(has3, "List was missing entity 3"); - fail_unless(!has4, "List had unexpected entity 4"); - fail_unless(!hasBad, "List had unexpected entity"); + g_assert_true(has1); + g_assert_false(has2); + g_assert_true(has3); + g_assert_false(has4); + g_assert_false(hasBad); g_object_unref(ent1); g_object_unref(ent2); @@ -139,10 +138,10 @@ START_TEST(test_intersect) g_object_unref(list2); g_object_unref(list3); } -END_TEST -START_TEST(test_filter) +static void +test_filter(void) { OsinfoDeviceList *list1 = osinfo_devicelist_new(); OsinfoDeviceList *list2; @@ -168,7 +167,7 @@ START_TEST(test_filter) list2 = OSINFO_DEVICELIST(osinfo_list_new_filtered(OSINFO_LIST(list1), filter)); - fail_unless(osinfo_list_get_length(OSINFO_LIST(list2)) == 3, "List did not have 3 elements"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(list2)), ==, 3); gboolean has1 = FALSE; gboolean has2 = FALSE; @@ -189,11 +188,11 @@ START_TEST(test_filter) else hasBad = TRUE; } - fail_unless(has1, "List was missing entity 1"); - fail_unless(has2, "List was missing entity 2"); - fail_unless(has3, "List was missing entity 3"); - fail_unless(!has4, "List had unexpected entity 4"); - fail_unless(!hasBad, "List had unexpected entity"); + g_assert_true(has1); + g_assert_true(has2); + g_assert_true(has3); + g_assert_false(has4); + g_assert_false(hasBad); g_object_unref(ent1); g_object_unref(ent2); @@ -203,26 +202,16 @@ START_TEST(test_filter) g_object_unref(list1); g_object_unref(list2); } -END_TEST -static Suite * -list_suite(void) +int +main(int argc, char *argv[]) { - Suite *s = suite_create("List"); - TCase *tc = tcase_create("Core"); - tcase_add_test(tc, test_union); - tcase_add_test(tc, test_intersect); - tcase_add_test(tc, test_filter); - suite_add_tcase(s, tc); - return s; -} + g_test_init(&argc, &argv, NULL); -int main(void) -{ - int number_failed; - Suite *s = list_suite(); - SRunner *sr = srunner_create(s); + g_test_add_func("/devicelist/union", test_union); + g_test_add_func("/devicelist/intersect", test_intersect); + g_test_add_func("/devicelist/filter", test_filter); /* Make sure we catch unexpected g_warning() */ g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); @@ -232,11 +221,7 @@ int main(void) osinfo_devicelist_get_type(); osinfo_filter_get_type(); - srunner_run_all(sr, CK_ENV); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); - - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return g_test_run(); } /* * Local variables: diff --git a/tests/test-entity.c b/tests/test-entity.c index 15da5ff..5f7233b 100644 --- a/tests/test-entity.c +++ b/tests/test-entity.c @@ -21,9 +21,7 @@ #include -#include #include -#include /* OsinfoEntity is abstract, so we need to trivially subclass it to test it */ typedef struct _OsinfoDummy OsinfoDummy; @@ -47,70 +45,69 @@ static void osinfo_dummy_class_init(OsinfoDummyClass *klass G_GNUC_UNUSED){} static void osinfo_dummy_init(OsinfoDummy *self G_GNUC_UNUSED) {} -START_TEST(test_id) +static void +test_id(void) { OsinfoEntity *ent = g_object_new(osinfo_dummy_get_type(), "id", "myentity", NULL); gchar *id; - fail_unless(g_strcmp0(osinfo_entity_get_id(ent), "myentity") == 0, - "Entity id was not 'myentity'"); + g_assert_cmpstr(osinfo_entity_get_id(ent), ==, "myentity"); g_object_get(ent, "id", &id, NULL); - fail_unless(g_strcmp0(id, "myentity") == 0, - "Entity id was not 'myentity'"); + g_assert_cmpstr(id, ==, "myentity"); g_free(id); g_object_unref(ent); } -END_TEST -START_TEST(test_empty_props) +static void +test_empty_props(void) { OsinfoEntity *ent = g_object_new(osinfo_dummy_get_type(), "id", "myentity", NULL); GList *keys = osinfo_entity_get_param_keys(ent); - fail_unless(keys != NULL, "Entity param key list was not empty"); - fail_unless(keys->next == NULL, "Entity param key list was not empty"); + g_assert_nonnull(keys); + g_assert_null(keys->next); g_list_free(keys); const gchar *value = osinfo_entity_get_param_value(ent, "wibble"); - fail_unless(value == NULL, "Entity param value was not NULL"); + g_assert_null(value); GList *values = osinfo_entity_get_param_value_list(ent, "wibble"); - fail_unless(values == NULL, "Entity param value list was not NULL"); + g_assert_null(values); g_object_unref(ent); } -END_TEST -START_TEST(test_single_prop_value) +static void +test_single_prop_value(void) { OsinfoEntity *ent = g_object_new(osinfo_dummy_get_type(), "id", "myentity", NULL); osinfo_entity_add_param(ent, "hello", "world"); GList *keys = osinfo_entity_get_param_keys(ent); - fail_unless(keys != NULL, "Entity param key list was empty"); - fail_unless(keys->next->next == NULL, "Entity param key list has too many values"); - fail_unless(g_strcmp0(keys->data, "hello") == 0, "Entity param key was not 'hello'"); + g_assert_nonnull(keys); + g_assert_null(keys->next->next); + g_assert_cmpstr(keys->data, ==, "hello"); g_list_free(keys); const gchar *value = osinfo_entity_get_param_value(ent, "hello"); - fail_unless(g_strcmp0(value, "world") == 0, "Entity param value was not 'world'"); + g_assert_cmpstr(value, ==, "world"); value = osinfo_entity_get_param_value(ent, "world"); - fail_unless(value == NULL, "Entity param bogus value was not NULL"); + g_assert_null(value); GList *values = osinfo_entity_get_param_value_list(ent, "hello"); - fail_unless(values != NULL, "Entity param value list was empty"); - fail_unless(values->next == NULL, "Entity param value list has too many values"); - fail_unless(g_strcmp0(values->data, "world") == 0, "Entity param list value was not 'world'"); + g_assert_nonnull(values); + g_assert_null(values->next); + g_assert_cmpstr(values->data, ==, "world"); g_list_free(values); g_object_unref(ent); } -END_TEST -START_TEST(test_multi_prop_value) +static void +test_multi_prop_value(void) { OsinfoEntity *ent = g_object_new(osinfo_dummy_get_type(), "id", "myentity", NULL); @@ -119,31 +116,31 @@ START_TEST(test_multi_prop_value) osinfo_entity_add_param(ent, "hello", "elephant"); GList *keys = osinfo_entity_get_param_keys(ent); - fail_unless(keys != NULL, "Entity param key list was empty"); - fail_unless(keys->next->next == NULL, "Entity param key list has too many values"); - fail_unless(g_strcmp0(keys->data, "hello") == 0, "Entity param key was not 'hello'"); + g_assert_nonnull(keys); + g_assert_null(keys->next->next); + g_assert_cmpstr(keys->data, ==, "hello"); g_list_free(keys); const gchar *value = osinfo_entity_get_param_value(ent, "hello"); - fail_unless(g_strcmp0(value, "world") == 0, "Entity param value was not 'world'"); + g_assert_cmpstr(value, ==, "world"); value = osinfo_entity_get_param_value(ent, "world"); - fail_unless(value == NULL, "Entity param bogus value was not NULL"); + g_assert_null(value); GList *values = osinfo_entity_get_param_value_list(ent, "hello"); - fail_unless(values != NULL, "Entity param value list was empty"); - fail_unless(values->next != NULL, "Entity param value list doesn't have enough values"); - fail_unless(values->next->next != NULL, "Entity param value list doesn't have enough values"); - fail_unless(values->next->next->next == NULL, "Entity param value list has too many values"); - fail_unless(g_strcmp0(values->data, "world") == 0, "Entity param list first value was not 'world'"); - fail_unless(g_strcmp0(values->next->data, "fred") == 0, "Entity param list second value was not 'fred'"); - fail_unless(g_strcmp0(values->next->next->data, "elephant") == 0, "Entity param list third was not 'elephant'"); + g_assert_nonnull(values); + g_assert_nonnull(values->next); + g_assert_nonnull(values->next->next); + g_assert_null(values->next->next->next); + g_assert_cmpstr(values->data, ==, "world"); + g_assert_cmpstr(values->next->data, ==, "fred"); + g_assert_cmpstr(values->next->next->data, ==, "elephant"); g_list_free(values); g_object_unref(ent); } -END_TEST -START_TEST(test_multi_props) +static void +test_multi_props(void) { OsinfoEntity *ent = g_object_new(osinfo_dummy_get_type(), "id", "myentity", NULL); @@ -168,43 +165,43 @@ START_TEST(test_multi_props) foundBad = TRUE; tmp = tmp->next; } - fail_unless(foundHello, "Entity param key list was missing 'hello'"); - fail_unless(foundFish, "Entity param key list was missing 'fish'"); - fail_unless(foundKevin, "Entity param key list was missing 'kevin'"); - fail_unless(!foundBad, "Entity param key list has unexpected key"); + g_assert_true(foundHello); + g_assert_true(foundFish); + g_assert_true(foundKevin); + g_assert_false(foundBad); g_list_free(keys); const gchar *value = osinfo_entity_get_param_value(ent, "hello"); - fail_unless(g_strcmp0(value, "world") == 0, "Entity param value was not 'world'"); + g_assert_cmpstr(value, ==, "world"); value = osinfo_entity_get_param_value(ent, "fish"); - fail_unless(g_strcmp0(value, "food") == 0, "Entity param value was not 'food'"); + g_assert_cmpstr(value, ==, "food"); value = osinfo_entity_get_param_value(ent, "kevin"); - fail_unless(g_strcmp0(value, "bacon") == 0, "Entity param value was not 'bacon'"); + g_assert_cmpstr(value, ==, "bacon"); GList *values = osinfo_entity_get_param_value_list(ent, "hello"); - fail_unless(values != NULL, "Entity param value list was empty"); - fail_unless(values->next == NULL, "Entity param value list has too many values"); - fail_unless(g_strcmp0(values->data, "world") == 0, "Entity param list value was not 'world'"); + g_assert_nonnull(values); + g_assert_null(values->next); + g_assert_cmpstr(values->data, ==, "world"); g_list_free(values); values = osinfo_entity_get_param_value_list(ent, "fish"); - fail_unless(values != NULL, "Entity param value list was empty"); - fail_unless(values->next == NULL, "Entity param value list has too many values"); - fail_unless(g_strcmp0(values->data, "food") == 0, "Entity param list value was not 'food'"); + g_assert_nonnull(values); + g_assert_null(values->next); + g_assert_cmpstr(values->data, ==, "food"); g_list_free(values); values = osinfo_entity_get_param_value_list(ent, "kevin"); - fail_unless(values != NULL, "Entity param value list was empty"); - fail_unless(values->next == NULL, "Entity param value list has too many values"); - fail_unless(g_strcmp0(values->data, "bacon") == 0, "Entity param list value was not 'bacon'"); + g_assert_nonnull(values); + g_assert_null(values->next); + g_assert_cmpstr(values->data, ==, "bacon"); g_list_free(values); g_object_unref(ent); } -END_TEST -START_TEST(test_multi_props_clear) +static void +test_multi_props_clear(void) { OsinfoEntity *ent = g_object_new(osinfo_dummy_get_type(), "id", "myentity", NULL); @@ -225,15 +222,15 @@ START_TEST(test_multi_props_clear) foundBad = TRUE; tmp = tmp->next; } - fail_unless(foundHello, "Entity param key list was missing 'hello'"); - fail_unless(foundFish, "Entity param key list was missing 'fish'"); - fail_unless(!foundBad, "Entity param key list has unexpected key"); + g_assert_true(foundHello); + g_assert_true(foundFish); + g_assert_false(foundBad); g_list_free(keys); const gchar *value = osinfo_entity_get_param_value(ent, "hello"); - fail_unless(g_strcmp0(value, "world") == 0, "Entity param value was not 'world'"); + g_assert_cmpstr(value, ==, "world"); value = osinfo_entity_get_param_value(ent, "fish"); - fail_unless(g_strcmp0(value, "food") == 0, "Entity param value was not 'food'"); + g_assert_cmpstr(value, ==, "food"); osinfo_entity_clear_param(ent, "hello"); @@ -251,15 +248,15 @@ START_TEST(test_multi_props_clear) foundBad = TRUE; tmp = tmp->next; } - fail_unless(!foundHello, "Entity param key list has unexpected 'hello'"); - fail_unless(foundFish, "Entity param key list was missing 'fish'"); - fail_unless(!foundBad, "Entity param key list has unexpected key"); + g_assert_false(foundHello); + g_assert_true(foundFish); + g_assert_false(foundBad); g_list_free(keys); value = osinfo_entity_get_param_value(ent, "hello"); - fail_unless(g_strcmp0(value, NULL) == 0, "Entity param value was not removed"); + g_assert_null(value); value = osinfo_entity_get_param_value(ent, "fish"); - fail_unless(g_strcmp0(value, "food") == 0, "Entity param value was not 'food'"); + g_assert_cmpstr(value, ==, "food"); osinfo_entity_add_param(ent, "hello", "world"); osinfo_entity_clear_param(ent, "fish"); @@ -278,63 +275,53 @@ START_TEST(test_multi_props_clear) foundBad = TRUE; tmp = tmp->next; } - fail_unless(foundHello, "Entity param key list has unexpected 'hello'"); - fail_unless(!foundFish, "Entity param key list was missing 'fish'"); - fail_unless(!foundBad, "Entity param key list has unexpected key"); + g_assert_true(foundHello); + g_assert_false(foundFish); + g_assert_false(foundBad); g_list_free(keys); value = osinfo_entity_get_param_value(ent, "hello"); - fail_unless(g_strcmp0(value, "world") == 0, "Entity param value was not readded"); + g_assert_cmpstr(value, ==, "world"); value = osinfo_entity_get_param_value(ent, "fish"); - fail_unless(g_strcmp0(value, NULL) == 0, "Entity param value was not removed"); + g_assert_null(value); g_object_unref(ent); } -END_TEST -START_TEST(test_int64_props) +static void +test_int64_props(void) { OsinfoEntity *ent = g_object_new(osinfo_dummy_get_type(), "id", "myentity", NULL); osinfo_entity_set_param_int64(ent, "my_int", 10); - fail_unless(osinfo_entity_get_param_value_int64(ent, "my_int") == 10); + g_assert_true(osinfo_entity_get_param_value_int64(ent, "my_int") == 10); osinfo_entity_set_param_int64(ent, "my_neg_int", -20); - fail_unless(osinfo_entity_get_param_value_int64(ent, "my_neg_int") == -20); + g_assert_true(osinfo_entity_get_param_value_int64(ent, "my_neg_int") == -20); osinfo_entity_set_param_int64(ent, "my_str", 30); - fail_unless(osinfo_entity_get_param_value_int64(ent, "my_str") == 30); + g_assert_true(osinfo_entity_get_param_value_int64(ent, "my_str") == 30); osinfo_entity_set_param_int64(ent, "my_neg_str", -40); - fail_unless(osinfo_entity_get_param_value_int64(ent, "my_neg_str") == -40); - fail_unless(osinfo_entity_get_param_value_int64_with_default(ent, "my_neg_str", 1234) == -40); + g_assert_true(osinfo_entity_get_param_value_int64(ent, "my_neg_str") == -40); + g_assert_true(osinfo_entity_get_param_value_int64_with_default(ent, "my_neg_str", 1234) == -40); - fail_unless(osinfo_entity_get_param_value_int64(ent, "missing") == -1); - fail_unless(osinfo_entity_get_param_value_int64_with_default(ent, "missing", 1234) == 1234); + g_assert_true(osinfo_entity_get_param_value_int64(ent, "missing") == -1); + g_assert_true(osinfo_entity_get_param_value_int64_with_default(ent, "missing", 1234) == 1234); g_object_unref(ent); } -END_TEST -static Suite * -entity_suite(void) +int +main(int argc, char *argv[]) { - Suite *s = suite_create("Entity"); - TCase *tc = tcase_create("Core"); - tcase_add_test(tc, test_id); - tcase_add_test(tc, test_empty_props); - tcase_add_test(tc, test_single_prop_value); - tcase_add_test(tc, test_multi_prop_value); - tcase_add_test(tc, test_multi_props); - tcase_add_test(tc, test_multi_props_clear); - tcase_add_test(tc, test_int64_props); - suite_add_tcase(s, tc); - return s; -} + g_test_init(&argc, &argv, NULL); -int main(void) -{ - int number_failed; - Suite *s = entity_suite(); - SRunner *sr = srunner_create(s); + g_test_add_func("/entity/id", test_id); + g_test_add_func("/entity/empty_props", test_empty_props); + g_test_add_func("/entity/single_prop_value", test_single_prop_value); + g_test_add_func("/entity/multi_prop_value", test_multi_prop_value); + g_test_add_func("/entity/multi_props", test_multi_props); + g_test_add_func("/entity/multi_props_clear", test_multi_props_clear); + g_test_add_func("/entity/int64_props", test_int64_props); /* Make sure we catch unexpected g_warning() */ g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); @@ -342,11 +329,7 @@ int main(void) /* Upfront so we don't confuse valgrind */ osinfo_dummy_get_type(); - srunner_run_all(sr, CK_ENV); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); - - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return g_test_run(); } /* * Local variables: diff --git a/tests/test-filter.c b/tests/test-filter.c index 7813325..3fbeb3e 100644 --- a/tests/test-filter.c +++ b/tests/test-filter.c @@ -21,63 +21,62 @@ #include -#include #include -#include -START_TEST(test_basic) +static void +test_basic(void) { OsinfoFilter *filter = osinfo_filter_new(); OsinfoDevice *dev = osinfo_device_new("e1000"); - fail_unless(OSINFO_IS_FILTER(filter), "Filter is a filter object"); - fail_unless(osinfo_filter_matches(filter, OSINFO_ENTITY(dev)), "Filter matches device"); + g_assert_true(OSINFO_IS_FILTER(filter)); + g_assert_true(osinfo_filter_matches(filter, OSINFO_ENTITY(dev))); osinfo_filter_add_constraint(filter, "class", "network"); GList *keys = osinfo_filter_get_constraint_keys(filter); - fail_unless(keys != NULL, "missing key"); - fail_unless(g_strcmp0(keys->data, "class") == 0, "missing key"); - fail_unless(keys->next == NULL, "too many keys"); + g_assert_nonnull(keys); + g_assert_cmpstr(keys->data, ==, "class"); + g_assert_null(keys->next); g_list_free(keys); osinfo_filter_add_constraint(filter, "class", "audio"); keys = osinfo_filter_get_constraint_keys(filter); - fail_unless(keys != NULL, "missing key"); - fail_unless(g_strcmp0(keys->data, "class") == 0, "missing key"); - fail_unless(keys->next == NULL, "too many keys"); + g_assert_nonnull(keys); + g_assert_cmpstr(keys->data, ==, "class"); + g_assert_null(keys->next); g_list_free(keys); osinfo_filter_add_constraint(filter, "bus", "pci"); keys = osinfo_filter_get_constraint_keys(filter); - fail_unless(keys != NULL, "missing key"); - fail_unless(keys->next != NULL, "not enough keys"); - fail_unless(g_strcmp0(keys->data, "bus") == 0, "missing bus key"); - fail_unless(g_strcmp0(keys->next->data, "class") == 0, "missing class key"); - fail_unless(keys->next->next == NULL, "too many keys"); + g_assert_nonnull(keys); + g_assert_nonnull(keys->next); + g_assert_cmpstr(keys->data, ==, "bus"); + g_assert_cmpstr(keys->next->data, ==, "class"); + g_assert_null(keys->next->next); g_list_free(keys); GList *values = osinfo_filter_get_constraint_values(filter, "bus"); - fail_unless(values != NULL, "missing value"); - fail_unless(g_strcmp0(values->data, "pci") == 0, "missing value"); - fail_unless(values->next == NULL, "too many keys"); + g_assert_nonnull(values); + g_assert_cmpstr(values->data, ==, "pci"); + g_assert_null(values->next); g_list_free(values); values = osinfo_filter_get_constraint_values(filter, "class"); - fail_unless(values != NULL, "missing value"); - fail_unless(values->next != NULL, "not enough values"); - fail_unless(g_strcmp0(values->data, "audio") == 0, "missing value"); - fail_unless(g_strcmp0(values->next->data, "network") == 0, "missing value"); - fail_unless(values->next->next == NULL, "too many values"); + g_assert_nonnull(values); + g_assert_nonnull(values->next); + g_assert_cmpstr(values->data, ==, "audio"); + g_assert_cmpstr(values->next->data, ==, "network"); + g_assert_null(values->next->next); g_list_free(values); g_object_unref(dev); g_object_unref(filter); } -END_TEST -START_TEST(test_filter_single) +static void +test_filter_single(void) { OsinfoFilter *filter = osinfo_filter_new(); OsinfoDevice *dev = osinfo_device_new("e1000"); @@ -85,21 +84,21 @@ START_TEST(test_filter_single) osinfo_entity_add_param(OSINFO_ENTITY(dev), "bus", "pci"); osinfo_filter_add_constraint(filter, "class", "network"); - fail_unless(!osinfo_filter_matches(filter, OSINFO_ENTITY(dev)), "Filter does not match device"); + g_assert_false(osinfo_filter_matches(filter, OSINFO_ENTITY(dev))); osinfo_entity_add_param(OSINFO_ENTITY(dev), "class", "network"); - fail_unless(osinfo_filter_matches(filter, OSINFO_ENTITY(dev)), "Filter matches device"); + g_assert_true(osinfo_filter_matches(filter, OSINFO_ENTITY(dev))); osinfo_filter_clear_constraint(filter, "class"); osinfo_filter_add_constraint(filter, "class", "audio"); - fail_unless(!osinfo_filter_matches(filter, OSINFO_ENTITY(dev)), "Filter does not match device"); + g_assert_false(osinfo_filter_matches(filter, OSINFO_ENTITY(dev))); g_object_unref(dev); g_object_unref(filter); } -END_TEST -START_TEST(test_filter_multi) +static void +test_filter_multi(void) { OsinfoFilter *filter = osinfo_filter_new(); OsinfoDevice *dev = osinfo_device_new("e1000"); @@ -107,26 +106,26 @@ START_TEST(test_filter_multi) osinfo_entity_add_param(OSINFO_ENTITY(dev), "bus", "pci"); osinfo_filter_add_constraint(filter, "bus", "isa"); - fail_unless(!osinfo_filter_matches(filter, OSINFO_ENTITY(dev)), "Filter does not match device"); + g_assert_false(osinfo_filter_matches(filter, OSINFO_ENTITY(dev))); osinfo_filter_add_constraint(filter, "bus", "pci"); /* XXX is this right ? Multiple values for a filter constraint * is treated as requiring all constraint values to match, not * required any to match */ - //fail_unless(osinfo_filter_matches(filter, OSINFO_ENTITY(dev)), "Filter matches device"); - fail_unless(!osinfo_filter_matches(filter, OSINFO_ENTITY(dev)), "Filter does not match device"); + //g_assert_true(osinfo_filter_matches(filter, OSINFO_ENTITY(dev))); + g_assert_false(osinfo_filter_matches(filter, OSINFO_ENTITY(dev))); osinfo_filter_clear_constraints(filter); osinfo_filter_add_constraint(filter, "bus", "pci"); - fail_unless(osinfo_filter_matches(filter, OSINFO_ENTITY(dev)), "Filter matches device"); + g_assert_true(osinfo_filter_matches(filter, OSINFO_ENTITY(dev))); g_object_unref(dev); g_object_unref(filter); } -END_TEST -START_TEST(test_filter_combine) +static void +test_filter_combine(void) { OsinfoFilter *filter = osinfo_filter_new(); OsinfoDevice *dev1 = osinfo_device_new("e1000"); @@ -139,38 +138,28 @@ START_TEST(test_filter_combine) osinfo_entity_add_param(OSINFO_ENTITY(dev2), "class", "network"); osinfo_filter_add_constraint(filter, "class", "network"); - fail_unless(osinfo_filter_matches(filter, OSINFO_ENTITY(dev1)), "Filter does not match device"); - fail_unless(osinfo_filter_matches(filter, OSINFO_ENTITY(dev2)), "Filter does not match device"); + g_assert_true(osinfo_filter_matches(filter, OSINFO_ENTITY(dev1))); + g_assert_true(osinfo_filter_matches(filter, OSINFO_ENTITY(dev2))); osinfo_filter_add_constraint(filter, "bus", "isa"); - fail_unless(!osinfo_filter_matches(filter, OSINFO_ENTITY(dev1)), "Filter match device"); - fail_unless(osinfo_filter_matches(filter, OSINFO_ENTITY(dev2)), "Filter does not match device"); + g_assert_false(osinfo_filter_matches(filter, OSINFO_ENTITY(dev1))); + g_assert_true(osinfo_filter_matches(filter, OSINFO_ENTITY(dev2))); g_object_unref(dev1); g_object_unref(dev2); g_object_unref(filter); } -END_TEST -static Suite * -filter_suite(void) +int +main(int argc, char *argv[]) { - Suite *s = suite_create("Filter"); - TCase *tc = tcase_create("Core"); - tcase_add_test(tc, test_basic); - tcase_add_test(tc, test_filter_single); - tcase_add_test(tc, test_filter_multi); - tcase_add_test(tc, test_filter_combine); - suite_add_tcase(s, tc); - return s; -} + g_test_init(&argc, &argv, NULL); -int main(void) -{ - int number_failed; - Suite *s = filter_suite(); - SRunner *sr = srunner_create(s); + g_test_add_func("/filter/basic", test_basic); + g_test_add_func("/filter/filter_single", test_filter_single); + g_test_add_func("/filter/filter_multi", test_filter_multi); + g_test_add_func("/filter/filter_combine", test_filter_combine); /* Make sure we catch unexpected g_warning() */ g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); @@ -179,11 +168,7 @@ int main(void) osinfo_device_get_type(); osinfo_filter_get_type(); - srunner_run_all(sr, CK_ENV); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); - - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return g_test_run(); } /* * Local variables: diff --git a/tests/test-install-script.c b/tests/test-install-script.c index 2e72106..129d995 100644 --- a/tests/test-install-script.c +++ b/tests/test-install-script.c @@ -21,10 +21,7 @@ #include -#include -#include #include -#include static GError *error = NULL; static gchar *actualData = NULL; @@ -130,7 +127,8 @@ static OsinfoMedia *create_media(void) return media; } -START_TEST(test_script_file) +static void +test_script_file(void) { OsinfoInstallScript *script; OsinfoInstallConfig *config = test_get_config(); @@ -144,7 +142,7 @@ START_TEST(test_script_file) "file://" SRCDIR "/tests/install-script.xsl"); osinfo_loader_process_path(loader, SRCDIR "/tests/dbdata", &error); - fail_unless(error == NULL, error ? error->message : "none"); + g_assert_no_error(error); db = g_object_ref(osinfo_loader_get_db(loader)); g_object_unref(loader); @@ -152,7 +150,7 @@ START_TEST(test_script_file) TRUE); media = create_media(); - fail_unless(osinfo_db_identify_media(db, media), "Failed to identify media"); + g_assert_true(osinfo_db_identify_media(db, media)); osinfo_install_script_generate_for_media_async(script, media, @@ -165,10 +163,9 @@ START_TEST(test_script_file) g_main_loop_run(loop); unlink(BUILDDIR "/tests/install-script-actual.txt"); - fail_unless(error == NULL, error ? error->message : "none"); + g_assert_no_error(error); - fail_unless(strcmp(actualData, expectData) == 0, "Actual '%s' match expect '%s'", - actualData, expectData); + g_assert_cmpstr(actualData, ==, expectData); g_free(actualData); g_object_unref(media); @@ -177,11 +174,11 @@ START_TEST(test_script_file) g_object_unref(script); g_main_loop_unref(loop); } -END_TEST -START_TEST(test_script_data) +static void +test_script_data(void) { OsinfoInstallScript *script; OsinfoInstallConfig *config = test_get_config(); @@ -193,16 +190,16 @@ START_TEST(test_script_data) gchar *data; g_file_load_contents(file, NULL, &data, NULL, NULL, &error); - fail_unless(error == NULL, error ? error->message : "none"); + g_assert_no_error(error); g_object_unref(file); osinfo_loader_process_path(loader, SRCDIR "/tests/dbdata", &error); - fail_unless(error == NULL, error ? error->message : "none"); + g_assert_no_error(error); db = g_object_ref(osinfo_loader_get_db(loader)); g_object_unref(loader); media = create_media(); - fail_unless(osinfo_db_identify_media(db, media), "Failed to identify media"); + g_assert_true(osinfo_db_identify_media(db, media)); script = osinfo_install_script_new_data("http://example.com", "jeos", @@ -222,7 +219,7 @@ START_TEST(test_script_data) g_main_loop_run(loop); unlink(BUILDDIR "/tests/install-script-actual.txt"); - fail_unless(error == NULL, error ? error->message : "none"); + g_assert_no_error(error); g_free(data); g_free(actualData); @@ -232,9 +229,9 @@ START_TEST(test_script_data) g_object_unref(script); g_main_loop_unref(loop); } -END_TEST -START_TEST(test_script_datamap) +static void +test_script_datamap(void) { OsinfoLoader *loader = osinfo_loader_new(); OsinfoDb *db; @@ -244,40 +241,34 @@ START_TEST(test_script_datamap) GMainLoop *loop; osinfo_loader_process_path(loader, SRCDIR "/tests/dbdata", &error); - fail_unless(error == NULL, error ? error->message : "none"); + g_assert_no_error(error); db = g_object_ref(osinfo_loader_get_db(loader)); g_object_unref(loader); - fail_unless(osinfo_db_get_datamap(db, "http://example.com/libosinfo/test-datamap") != NULL, "Could not find OsinfoDatamap 'test-datamap'"); - fail_unless(osinfo_db_get_datamap(db, "http://example.com/libosinfo/test-datamap2") != NULL, "Could not find OsinfoDatamap 'test-datamap2'"); + g_assert_nonnull(osinfo_db_get_datamap(db, "http://example.com/libosinfo/test-datamap")); + g_assert_nonnull(osinfo_db_get_datamap(db, "http://example.com/libosinfo/test-datamap2")); script = osinfo_db_get_install_script(db, "http://example.com/libosinfo/test-install-script"); - fail_unless(script != NULL, "Could not find OsinfoInstallScript 'test-install-script'"); + g_assert_nonnull(script); config = osinfo_install_config_new("http://example.com"); osinfo_install_config_set_l10n_keyboard(config, "unknown"); - fail_unless(g_strcmp0(osinfo_install_config_get_l10n_keyboard(config), "unknown") == 0, - "Got %s instead of 'unknown'", osinfo_install_config_get_l10n_keyboard(config)); + g_assert_cmpstr(osinfo_install_config_get_l10n_keyboard(config), ==, "unknown"); osinfo_install_config_set_l10n_keyboard(config, "val1"); - fail_unless(g_strcmp0(osinfo_install_config_get_l10n_keyboard(config), "val1") == 0, - "Got %s instead of 'val1'", osinfo_install_config_get_l10n_keyboard(config)); + g_assert_cmpstr(osinfo_install_config_get_l10n_keyboard(config), ==, "val1"); osinfo_install_config_set_l10n_keyboard(config, "val2"); - fail_unless(g_strcmp0(osinfo_install_config_get_l10n_keyboard(config), "val2") == 0, - "Got %s instead of 'val2'", osinfo_install_config_get_l10n_keyboard(config)); + g_assert_cmpstr(osinfo_install_config_get_l10n_keyboard(config), ==, "val2"); osinfo_install_config_set_l10n_keyboard(config, "val3"); - fail_unless(g_strcmp0(osinfo_install_config_get_l10n_keyboard(config), "val3") == 0, - "Got %s instead of 'val3'", osinfo_install_config_get_l10n_keyboard(config)); + g_assert_cmpstr(osinfo_install_config_get_l10n_keyboard(config), ==, "val3"); osinfo_install_config_set_l10n_keyboard(config, "VAL1"); - fail_unless(g_strcmp0(osinfo_install_config_get_l10n_keyboard(config), "VAL1") == 0, - "Got %s instead of 'VAL1", osinfo_install_config_get_l10n_keyboard(config)); + g_assert_cmpstr(osinfo_install_config_get_l10n_keyboard(config), ==, "VAL1"); osinfo_install_config_set_l10n_language(config, "en_EN"); - fail_unless(g_strcmp0(osinfo_install_config_get_l10n_language(config), "en_EN") == 0, - "Got %s instead of 'en_EN'", osinfo_install_config_get_l10n_language(config)); + g_assert_cmpstr(osinfo_install_config_get_l10n_language(config), ==, "en_EN"); osinfo_install_config_set_l10n_language(config, "fr_FR"); osinfo_install_config_set_l10n_timezone(config, "Europe/Paris"); @@ -300,10 +291,9 @@ START_TEST(test_script_datamap) g_main_loop_run(loop); unlink(BUILDDIR "/tests/install-script-actual.txt"); - fail_unless(error == NULL, error ? error->message : "none"); + g_assert_no_error(error); - fail_unless(strcmp(actualData, expectData2) == 0, "Actual '%s' match expect '%s'", - actualData, expectData2); + g_assert_cmpstr(actualData, ==, expectData2); g_free(actualData); g_object_unref(db); @@ -311,28 +301,16 @@ START_TEST(test_script_datamap) g_object_unref(config); g_main_loop_unref(loop); } -END_TEST -static Suite * -list_suite(void) +int +main(int argc, char *argv[]) { - Suite *s = suite_create("List"); - TCase *tc = tcase_create("Core"); - tcase_set_timeout(tc, 120); - - tcase_add_test(tc, test_script_file); - tcase_add_test(tc, test_script_data); - tcase_add_test(tc, test_script_datamap); - suite_add_tcase(s, tc); - return s; -} + g_test_init(&argc, &argv, NULL); -int main(void) -{ - int number_failed; - Suite *s = list_suite(); - SRunner *sr = srunner_create(s); + g_test_add_func("/install-script/script_file", test_script_file); + g_test_add_func("/install-script/script_data", test_script_data); + g_test_add_func("/install-script/script_datamap", test_script_datamap); /* Make sure we catch unexpected g_warning() */ g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); @@ -349,11 +327,7 @@ int main(void) osinfo_oslist_get_type(); osinfo_filter_get_type(); - srunner_run_all(sr, CK_ENV); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); - - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return g_test_run(); } /* * Local variables: diff --git a/tests/test-isodetect.c b/tests/test-isodetect.c index 7214531..97c86c4 100644 --- a/tests/test-isodetect.c +++ b/tests/test-isodetect.c @@ -22,8 +22,8 @@ #include #include +#include #include -#include struct ISOInfo { gchar *shortid; @@ -321,15 +321,13 @@ static void test_langs(struct ISOInfo *info) langs = osinfo_media_get_languages(info->media); for (it = langs; it != NULL; it = it->next) { - fail_unless(g_hash_table_contains(info->langs, it->data), - "%s not a known language for ISO %s", - it->data, info->filename); + g_test_message("checking ISO %s, language %s", + info->filename, (const char *)it->data); + g_assert_true(g_hash_table_contains(info->langs, it->data)); g_hash_table_remove(info->langs, it->data); } g_list_free(langs); - fail_unless(g_hash_table_size(info->langs) == 0, - "some languages were not identified on ISO %s", - info->filename); + g_assert_cmpint(g_hash_table_size(info->langs), ==, 0); } static void test_one(const gchar *vendor) @@ -340,15 +338,15 @@ static void test_one(const gchar *vendor) GList *tmp; GError *error = NULL; - fail_unless(OSINFO_IS_LOADER(loader), "Loader is not a LOADER"); - fail_unless(OSINFO_IS_DB(db), "Db is not a DB"); + g_assert_true(OSINFO_IS_LOADER(loader)); + g_assert_true(OSINFO_IS_DB(db)); osinfo_loader_process_default_path(loader, &error); - fail_unless(error == NULL, error ? error->message : "none"); + g_assert_no_error(error); isos = load_isos(vendor, &error); - fail_unless(isos != NULL, "ISOs must not be NULL"); + g_assert_nonnull(isos); tmp = isos; while (tmp) { @@ -356,14 +354,13 @@ static void test_one(const gchar *vendor) gboolean matched = osinfo_db_identify_media(db, info->media); OsinfoOs *os; - fail_unless(matched, "ISO %s was not matched by OS %s", - info->filename, info->shortid); + g_test_message("checking OS %s for ISO %s", + info->shortid, info->filename); + g_assert_true(matched); g_object_get(info->media, "os", &os, NULL); const gchar *shortid = osinfo_product_get_short_id(OSINFO_PRODUCT(os)); - fail_unless(g_str_equal(shortid, info->shortid), - "ISO %s matched OS %s instead of expected %s", - info->filename, shortid, info->shortid); + g_assert_cmpstr(shortid, ==, info->shortid); g_object_unref(G_OBJECT(os)); test_langs(info); @@ -376,120 +373,109 @@ static void test_one(const gchar *vendor) g_object_unref(loader); } -START_TEST(test_fedora) +static void +test_fedora(void) { test_one("fedora"); } -END_TEST -START_TEST(test_rhel) +static void +test_rhel(void) { test_one("rhel"); } -END_TEST -START_TEST(test_ubuntu) +static void +test_ubuntu(void) { test_one("ubuntu"); } -END_TEST -START_TEST(test_debian) +static void +test_debian(void) { test_one("debian"); } -END_TEST -START_TEST(test_windows) +static void +test_windows(void) { test_one("windows"); } -END_TEST -START_TEST(test_freebsd) +static void +test_freebsd(void) { test_one("freebsd"); } -END_TEST -START_TEST(test_openbsd) +static void +test_openbsd(void) { test_one("openbsd"); } -END_TEST -START_TEST(test_opensuse) +static void +test_opensuse(void) { test_one("opensuse"); } -END_TEST -START_TEST(test_centos) +static void +test_centos(void) { test_one("centos"); } -END_TEST -START_TEST(test_gnome) +static void +test_gnome(void) { test_one("gnome"); } -END_TEST -START_TEST(test_altlinux) +static void +test_altlinux(void) { test_one("altlinux"); } -END_TEST -START_TEST(test_mageia) +static void +test_mageia(void) { test_one("mageia"); } -END_TEST -START_TEST(test_sles) +static void +test_sles(void) { test_one("sles"); } -END_TEST -START_TEST(test_sled) +static void +test_sled(void) { test_one("sled"); } -END_TEST -static Suite * -list_suite(void) +int +main(int argc, char *argv[]) { - Suite *s = suite_create("List"); - TCase *tc = tcase_create("Core"); - tcase_set_timeout(tc, 20); - - tcase_add_test(tc, test_fedora); - tcase_add_test(tc, test_rhel); - tcase_add_test(tc, test_ubuntu); - tcase_add_test(tc, test_debian); - tcase_add_test(tc, test_windows); - tcase_add_test(tc, test_freebsd); - tcase_add_test(tc, test_openbsd); - tcase_add_test(tc, test_opensuse); - tcase_add_test(tc, test_centos); - tcase_add_test(tc, test_gnome); - tcase_add_test(tc, test_altlinux); - tcase_add_test(tc, test_mageia); - tcase_add_test(tc, test_sles); - tcase_add_test(tc, test_sled); - suite_add_tcase(s, tc); - return s; -} - -int main(void) -{ - int number_failed; - Suite *s = list_suite(); - SRunner *sr = srunner_create(s); + g_test_init(&argc, &argv, NULL); + + g_test_add_func("/isodetect/fedora", test_fedora); + g_test_add_func("/isodetect/rhel", test_rhel); + g_test_add_func("/isodetect/ubuntu", test_ubuntu); + g_test_add_func("/isodetect/debian", test_debian); + g_test_add_func("/isodetect/windows", test_windows); + g_test_add_func("/isodetect/freebsd", test_freebsd); + g_test_add_func("/isodetect/openbsd", test_openbsd); + g_test_add_func("/isodetect/opensuse", test_opensuse); + g_test_add_func("/isodetect/centos", test_centos); + g_test_add_func("/isodetect/gnome", test_gnome); + g_test_add_func("/isodetect/altlinux", test_altlinux); + g_test_add_func("/isodetect/mageia", test_mageia); + g_test_add_func("/isodetect/sles", test_sles); + g_test_add_func("/isodetect/sled", test_sled); /* Make sure we catch unexpected g_warning() */ g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); @@ -506,11 +492,7 @@ int main(void) osinfo_oslist_get_type(); osinfo_filter_get_type(); - srunner_run_all(sr, CK_ENV); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); - - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return g_test_run(); } /* * Local variables: diff --git a/tests/test-list.c b/tests/test-list.c index 5480482..df1c973 100644 --- a/tests/test-list.c +++ b/tests/test-list.c @@ -21,9 +21,7 @@ #include -#include #include -#include /* OsinfoEntity is abstract, so we need to trivially subclass it to test it */ typedef struct _OsinfoDummy OsinfoDummy; @@ -69,46 +67,47 @@ static void osinfo_dummy_list_init(OsinfoDummyList *self G_GNUC_UNUSED) {} -START_TEST(test_basic) +static void +test_basic(void) { OsinfoList *list = g_object_new(osinfo_dummy_list_get_type(), NULL); - fail_unless(osinfo_list_get_length(list) == 0, "List was not empty"); - fail_unless(osinfo_list_find_by_id(list, "wibble") == NULL, "List was not empty"); + g_assert_cmpint(osinfo_list_get_length(list), ==, 0); + g_assert_null(osinfo_list_find_by_id(list, "wibble")); GType type; g_object_get(list, "element-type", &type, NULL); - fail_unless(type == OSINFO_TYPE_ENTITY, "Type is not entity"); + g_assert_cmpint(type, ==, OSINFO_TYPE_ENTITY); type = osinfo_list_get_element_type(list); - fail_unless(type == OSINFO_TYPE_ENTITY, "Type is not entity"); + g_assert_cmpint(type, ==, OSINFO_TYPE_ENTITY); g_object_unref(list); } -END_TEST -START_TEST(test_lookup) +static void +test_lookup(void) { OsinfoList *list = g_object_new(osinfo_dummy_list_get_type(), NULL); OsinfoEntity *ent = g_object_new(osinfo_dummy_get_type(), "id", "wibble", NULL); osinfo_list_add(list, ent); - fail_unless(osinfo_list_get_length(list) == 1, "List does not contain a single element"); - fail_unless(osinfo_list_get_nth(list, 0) == ent, "Lookup wrong element"); - fail_unless(osinfo_list_find_by_id(list, "wibble") != NULL, "Could not find element"); - fail_unless(osinfo_list_find_by_id(list, "fish") == NULL, "Found wrong element"); + g_assert_cmpint(osinfo_list_get_length(list), ==, 1); + g_assert_true(osinfo_list_get_nth(list, 0) == ent); + g_assert_nonnull(osinfo_list_find_by_id(list, "wibble")); + g_assert_null(osinfo_list_find_by_id(list, "fish")); g_object_unref(ent); g_object_unref(list); } -END_TEST -START_TEST(test_duplicate) +static void +test_duplicate(void) { OsinfoList *list = g_object_new(osinfo_dummy_list_get_type(), NULL); OsinfoEntity *ent = g_object_new(osinfo_dummy_get_type(), "id", "wibble", NULL); @@ -117,20 +116,20 @@ START_TEST(test_duplicate) osinfo_list_add(list, ent); osinfo_list_add(list, ent_dup); - fail_unless(osinfo_list_get_length(list) == 1, "List does not contain a single element"); - fail_unless(osinfo_list_get_nth(list, 0) == ent_dup, "Lookup wrong element"); - fail_unless(osinfo_list_find_by_id(list, "wibble") != NULL, "Could not find element"); - fail_unless(osinfo_list_find_by_id(list, "fish") == NULL, "Found wrong element"); + g_assert_cmpint(osinfo_list_get_length(list), ==, 1); + g_assert_true(osinfo_list_get_nth(list, 0) == ent_dup); + g_assert_nonnull(osinfo_list_find_by_id(list, "wibble")); + g_assert_null(osinfo_list_find_by_id(list, "fish")); g_object_unref(ent); g_object_unref(ent_dup); g_object_unref(list); } -END_TEST -START_TEST(test_union) +static void +test_union(void) { OsinfoList *list1 = g_object_new(osinfo_dummy_list_get_type(), NULL); OsinfoList *list2 = g_object_new(osinfo_dummy_list_get_type(), NULL); @@ -151,7 +150,7 @@ START_TEST(test_union) osinfo_list_add_union(list3, list1, list2); - fail_unless(osinfo_list_get_length(list3) == 4, "List did not have 4 elements"); + g_assert_cmpint(osinfo_list_get_length(list3), ==, 4); gboolean has1 = FALSE; gboolean has2 = FALSE; @@ -172,11 +171,11 @@ START_TEST(test_union) else hasBad = TRUE; } - fail_unless(has1, "List was missing entity 1"); - fail_unless(has2, "List was missing entity 2"); - fail_unless(has3, "List was missing entity 3"); - fail_unless(has4, "List was missing entity 4"); - fail_unless(!hasBad, "List had unexpected entity"); + g_assert_true(has1); + g_assert_true(has2); + g_assert_true(has3); + g_assert_true(has4); + g_assert_false(hasBad); g_object_unref(ent1); g_object_unref(ent1_dup); @@ -187,10 +186,10 @@ START_TEST(test_union) g_object_unref(list2); g_object_unref(list3); } -END_TEST -START_TEST(test_intersect) +static void +test_intersect(void) { OsinfoList *list1 = g_object_new(osinfo_dummy_list_get_type(), NULL); OsinfoList *list2 = g_object_new(osinfo_dummy_list_get_type(), NULL); @@ -212,7 +211,7 @@ START_TEST(test_intersect) osinfo_list_add_intersection(list3, list1, list2); - fail_unless(osinfo_list_get_length(list3) == 2, "List did not have 2 elements"); + g_assert_cmpint(osinfo_list_get_length(list3), ==, 2); gboolean has1 = FALSE; gboolean has2 = FALSE; @@ -233,11 +232,11 @@ START_TEST(test_intersect) else hasBad = TRUE; } - fail_unless(has1, "List was missing entity 1"); - fail_unless(!has2, "List had unexpected entity 2"); - fail_unless(has3, "List was missing entity 3"); - fail_unless(!has4, "List had unexpected entity 4"); - fail_unless(!hasBad, "List had unexpected entity"); + g_assert_true(has1); + g_assert_false(has2); + g_assert_true(has3); + g_assert_false(has4); + g_assert_false(hasBad); g_object_unref(ent1); g_object_unref(ent1_dup); @@ -248,10 +247,10 @@ START_TEST(test_intersect) g_object_unref(list2); g_object_unref(list3); } -END_TEST -START_TEST(test_filter) +static void +test_filter(void) { OsinfoList *list1 = g_object_new(osinfo_dummy_list_get_type(), NULL); OsinfoList *list2 = g_object_new(osinfo_dummy_list_get_type(), NULL); @@ -277,7 +276,7 @@ START_TEST(test_filter) osinfo_list_add_filtered(list2, list1, filter); - fail_unless(osinfo_list_get_length(list2) == 3, "List did not have 3 elements"); + g_assert_cmpint(osinfo_list_get_length(list2), ==, 3); gboolean has1 = FALSE; gboolean has2 = FALSE; @@ -298,11 +297,11 @@ START_TEST(test_filter) else hasBad = TRUE; } - fail_unless(has1, "List was missing entity 1"); - fail_unless(has2, "List was missing entity 2"); - fail_unless(has3, "List was missing entity 3"); - fail_unless(!has4, "List had unexpected entity 4"); - fail_unless(!hasBad, "List had unexpected entity"); + g_assert_true(has1); + g_assert_true(has2); + g_assert_true(has3); + g_assert_false(has4); + g_assert_false(hasBad); g_object_unref(ent1); g_object_unref(ent2); @@ -312,7 +311,6 @@ START_TEST(test_filter) g_object_unref(list1); g_object_unref(list2); } -END_TEST struct iterateData { OsinfoEntity *ent1; @@ -343,7 +341,8 @@ static void iterator(gpointer data, gpointer opaque) idata->hasBad = TRUE; } -START_TEST(test_iterate) +static void +test_iterate(void) { OsinfoList *list1 = g_object_new(osinfo_dummy_list_get_type(), NULL); OsinfoList *list2 = g_object_new(osinfo_dummy_list_get_type(), NULL); @@ -366,22 +365,22 @@ START_TEST(test_iterate) GList *elements = osinfo_list_get_elements(list1); g_list_foreach(elements, iterator, &data); g_list_free(elements); - fail_unless(data.has1, "List was missing entity 1"); - fail_unless(data.has2, "List was missing entity 2"); - fail_unless(data.has3, "List was missing entity 3"); - fail_unless(!data.has4, "List has unexpected entity 4"); - fail_unless(!data.hasBad, "List had unexpected entity"); + g_assert_true(data.has1); + g_assert_true(data.has2); + g_assert_true(data.has3); + g_assert_false(data.has4); + g_assert_false(data.hasBad); data.has1 = data.has2 = data.has3 = data.has4 = data.hasBad = FALSE; elements = osinfo_list_get_elements(list2); g_list_foreach(elements, iterator, &data); g_list_free(elements); - fail_unless(data.has1, "List was missing entity 1"); - fail_unless(!data.has2, "List has unexpected entity 2"); - fail_unless(!data.has3, "List has unexpected entity 3"); - fail_unless(data.has4, "List was missing entity 4"); - fail_unless(!data.hasBad, "List had unexpected entity"); + g_assert_true(data.has1); + g_assert_false(data.has2); + g_assert_false(data.has3); + g_assert_true(data.has4); + g_assert_false(data.hasBad); g_object_unref(ent1); g_object_unref(ent2); @@ -390,29 +389,19 @@ START_TEST(test_iterate) g_object_unref(list1); g_object_unref(list2); } -END_TEST -static Suite * -list_suite(void) +int +main(int argc, char *argv[]) { - Suite *s = suite_create("List"); - TCase *tc = tcase_create("Core"); - tcase_add_test(tc, test_basic); - tcase_add_test(tc, test_lookup); - tcase_add_test(tc, test_duplicate); - tcase_add_test(tc, test_union); - tcase_add_test(tc, test_intersect); - tcase_add_test(tc, test_filter); - tcase_add_test(tc, test_iterate); - suite_add_tcase(s, tc); - return s; -} + g_test_init(&argc, &argv, NULL); -int main(void) -{ - int number_failed; - Suite *s = list_suite(); - SRunner *sr = srunner_create(s); + g_test_add_func("/list/basic", test_basic); + g_test_add_func("/list/lookup", test_lookup); + g_test_add_func("/list/duplicate", test_duplicate); + g_test_add_func("/list/union", test_union); + g_test_add_func("/list/intersect", test_intersect); + g_test_add_func("/list/filter", test_filter); + g_test_add_func("/list/iterate", test_iterate); /* Make sure we catch unexpected g_warning() */ g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); @@ -422,11 +411,7 @@ int main(void) osinfo_dummy_list_get_type(); osinfo_filter_get_type(); - srunner_run_all(sr, CK_ENV); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); - - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return g_test_run(); } /* * Local variables: diff --git a/tests/test-loader.c b/tests/test-loader.c index 78c6713..680075d 100644 --- a/tests/test-loader.c +++ b/tests/test-loader.c @@ -21,39 +21,28 @@ #include -#include #include -#include -START_TEST(test_basic) +static void +test_basic(void) { OsinfoLoader *loader = osinfo_loader_new(); - fail_unless(OSINFO_IS_LOADER(loader), "Loader is not a LOADER"); + g_assert_true(OSINFO_IS_LOADER(loader)); GError *error = NULL; osinfo_loader_process_default_path(loader, &error); - fail_unless(error == NULL, error ? error->message : "none"); + g_assert_no_error(error); g_object_unref(loader); } -END_TEST -static Suite * -loader_suite(void) +int +main(int argc, char *argv[]) { - Suite *s = suite_create("Loader"); - TCase *tc = tcase_create("Core"); - tcase_add_test(tc, test_basic); - suite_add_tcase(s, tc); - return s; -} + g_test_init(&argc, &argv, NULL); -int main(void) -{ - int number_failed; - Suite *s = loader_suite(); - SRunner *sr = srunner_create(s); + g_test_add_func("/loader/basic", test_basic); /* Make sure we catch unexpected g_warning() */ g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); @@ -71,11 +60,7 @@ int main(void) osinfo_filter_get_type(); osinfo_loader_get_type(); - srunner_run_all(sr, CK_ENV); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); - - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return g_test_run(); } /* * Local variables: diff --git a/tests/test-mediauris.c b/tests/test-mediauris.c index 52d1e1c..5ac2c8e 100644 --- a/tests/test-mediauris.c +++ b/tests/test-mediauris.c @@ -21,10 +21,8 @@ #include -#include #include #include -#include #include static void test_media(OsinfoMediaList *medialist, GError **error, CURL *curl) @@ -43,14 +41,15 @@ static void test_media(OsinfoMediaList *medialist, GError **error, CURL *curl) continue; } - g_print("%s\n", url); + g_test_message("%s", url); curl_easy_setopt(curl, CURLOPT_URL, url); res = curl_easy_perform(curl); if (res != CURLE_OK) { curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code); } - fail_unless(res == CURLE_OK, "Failed HEAD (res=%d, %s; code=%ld) on %s", res, curl_easy_strerror(res), response_code, url); + g_test_message("res=%d, %s; code=%ld", res, curl_easy_strerror(res), response_code); + g_assert_cmpint(res, ==, CURLE_OK); tmp = tmp->next; } @@ -58,7 +57,8 @@ static void test_media(OsinfoMediaList *medialist, GError **error, CURL *curl) g_list_free(mediael); } -START_TEST(test_uris) +static void +test_uris(void) { CURL *curl; OsinfoLoader *loader = osinfo_loader_new(); @@ -81,11 +81,11 @@ START_TEST(test_uris) curl_easy_setopt(curl, CURLOPT_VERBOSE, debug_level > 0 ? 1L : 0L); } - fail_unless(OSINFO_IS_LOADER(loader), "Loader is not a LOADER"); - fail_unless(OSINFO_IS_DB(db), "Db is not a DB"); + g_assert_true(OSINFO_IS_LOADER(loader)); + g_assert_true(OSINFO_IS_DB(db)); osinfo_loader_process_default_path(loader, &error); - fail_unless(error == NULL, error ? error->message : "none"); + g_assert_no_error(error); oslist = osinfo_db_get_os_list(db); tmp = osel = osinfo_list_get_elements(OSINFO_LIST(oslist)); @@ -95,7 +95,7 @@ START_TEST(test_uris) test_media(medialist, &error, curl); - fail_unless(error == NULL, error ? error->message : "none"); + g_assert_no_error(error); g_object_unref(medialist); tmp = tmp->next; @@ -109,27 +109,17 @@ START_TEST(test_uris) g_object_unref(loader); } -END_TEST -static Suite * -list_suite(void) +int +main(int argc, char *argv[]) { - Suite *s = suite_create("List"); - TCase *tc = tcase_create("Core"); - tcase_set_timeout(tc, 300); + int ret; - tcase_add_test(tc, test_uris); - suite_add_tcase(s, tc); - return s; -} + g_test_init(&argc, &argv, NULL); -int main(void) -{ - int number_failed; - Suite *s = list_suite(); - SRunner *sr = srunner_create(s); + g_test_add_func("/mediauris/uris", test_uris); /* Make sure we catch unexpected g_warning() */ g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); @@ -150,13 +140,11 @@ int main(void) osinfo_oslist_get_type(); osinfo_filter_get_type(); - srunner_run_all(sr, CK_ENV); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); + ret = g_test_run(); curl_global_cleanup(); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return ret; } /* * Local variables: diff --git a/tests/test-os.c b/tests/test-os.c index 3c60e17..d62117c 100644 --- a/tests/test-os.c +++ b/tests/test-os.c @@ -21,24 +21,23 @@ #include -#include #include -#include -START_TEST(test_basic) +static void +test_basic(void) { OsinfoOs *os = osinfo_os_new("pony"); - fail_unless(OSINFO_IS_OS(os), "Os is a os object"); - fail_unless(g_strcmp0(osinfo_entity_get_id(OSINFO_ENTITY(os)), "pony") == 0, "Os ID was pony"); + g_assert_true(OSINFO_IS_OS(os)); + g_assert_cmpstr(osinfo_entity_get_id(OSINFO_ENTITY(os)), ==, "pony"); g_object_unref(os); } -END_TEST -START_TEST(test_devices) +static void +test_devices(void) { OsinfoOs *os = osinfo_os_new("awesome"); OsinfoDevice *dev1 = osinfo_device_new("e1000"); @@ -51,19 +50,19 @@ START_TEST(test_devices) OsinfoDeviceList *devices = osinfo_os_get_devices(os, NULL); - fail_unless(osinfo_list_get_length(OSINFO_LIST(devices)) == 2, "Os has two devices"); - fail_unless(osinfo_list_get_nth(OSINFO_LIST(devices), 0) == OSINFO_ENTITY(dev1), "Got device 1"); - fail_unless(osinfo_list_get_nth(OSINFO_LIST(devices), 1) == OSINFO_ENTITY(dev2), "Got device 2"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(devices)), ==, 2); + g_assert_true(osinfo_list_get_nth(OSINFO_LIST(devices), 0) == OSINFO_ENTITY(dev1)); + g_assert_true(osinfo_list_get_nth(OSINFO_LIST(devices), 1) == OSINFO_ENTITY(dev2)); g_object_unref(devices); g_object_unref(dev1); g_object_unref(dev2); g_object_unref(os); } -END_TEST -START_TEST(test_loader) +static void +test_loader(void) { OsinfoLoader *loader; OsinfoDb *db; @@ -73,69 +72,64 @@ START_TEST(test_loader) loader = osinfo_loader_new(); osinfo_loader_process_path(loader, SRCDIR "/tests/dbdata", &error); - fail_unless(error == NULL, error ? error->message:"none"); + g_assert_no_error(error); db = osinfo_loader_get_db(loader); os = osinfo_db_get_os(db, "http://libosinfo.org/test/os/test1"); - fail_unless(os != NULL, "could not find OS 'test1'"); + g_assert_nonnull(os); str = osinfo_product_get_short_id(OSINFO_PRODUCT(os)); - fail_unless(g_strcmp0(str, "test1") == 0, "wrong OS short-id"); + g_assert_cmpstr(str, ==, "test1"); str = osinfo_product_get_name(OSINFO_PRODUCT(os)); - fail_unless(g_strcmp0(str, "Test 1") == 0, "wrong OS name"); + g_assert_cmpstr(str, ==, "Test 1"); str = osinfo_product_get_version(OSINFO_PRODUCT(os)); - fail_unless(g_strcmp0(str, "unknown") == 0, "wrong OS version"); + g_assert_cmpstr(str, ==, "unknown"); str = osinfo_product_get_vendor(OSINFO_PRODUCT(os)); - fail_unless(g_strcmp0(str, "libosinfo.org") == 0, "wrong OS vendor"); + g_assert_cmpstr(str, ==, "libosinfo.org"); str = osinfo_os_get_family(os); - fail_unless(g_strcmp0(str, "test") == 0, "wrong OS family"); - fail_unless(osinfo_os_get_release_status(os) == OSINFO_RELEASE_STATUS_PRERELEASE, - "OS should be a pre-release"); + g_assert_cmpstr(str, ==, "test"); + g_assert_cmpint(osinfo_os_get_release_status(os), ==, OSINFO_RELEASE_STATUS_PRERELEASE); os = osinfo_db_get_os(db, "http://libosinfo.org/test/os/test2"); - fail_unless(os != NULL, "could not find OS 'test2'"); + g_assert_nonnull(os); str = osinfo_product_get_short_id(OSINFO_PRODUCT(os)); - fail_unless(g_strcmp0(str, "test2") == 0, "wrong OS short-id"); + g_assert_cmpstr(str, ==, "test2"); str = osinfo_product_get_name(OSINFO_PRODUCT(os)); - fail_unless(str == NULL, "wrong OS name"); + g_assert_null(str); str = osinfo_product_get_version(OSINFO_PRODUCT(os)); - fail_unless(str == NULL, "wrong OS version"); + g_assert_null(str); str = osinfo_product_get_vendor(OSINFO_PRODUCT(os)); - fail_unless(str == NULL, "wrong OS vendor"); + g_assert_null(str); str = osinfo_os_get_family(os); - fail_unless(str == NULL, "wrong OS family"); - fail_unless(osinfo_os_get_release_status(os) == OSINFO_RELEASE_STATUS_RELEASED, - "OS should be a released one"); + g_assert_null(str); + g_assert_cmpint(osinfo_os_get_release_status(os), ==, OSINFO_RELEASE_STATUS_RELEASED); os = osinfo_db_get_os(db, "http://libosinfo.org/test/os/test3"); - fail_unless(os != NULL, "could not find OS 'test3'"); + g_assert_nonnull(os); str = osinfo_product_get_short_id(OSINFO_PRODUCT(os)); - fail_unless(g_strcmp0(str, "test3") == 0, "wrong OS short-id"); - fail_unless(osinfo_os_get_release_status(os) == OSINFO_RELEASE_STATUS_RELEASED, - "OS should be a released one"); + g_assert_cmpstr(str, ==, "test3"); + g_assert_cmpint(osinfo_os_get_release_status(os), ==, OSINFO_RELEASE_STATUS_RELEASED); os = osinfo_db_get_os(db, "http://libosinfo.org/test/os/test4"); - fail_unless(os != NULL, "could not find OS 'test4'"); + g_assert_nonnull(os); str = osinfo_product_get_short_id(OSINFO_PRODUCT(os)); - fail_unless(g_strcmp0(str, "test4") == 0, "wrong OS short-id"); - fail_unless(osinfo_os_get_release_status(os) == OSINFO_RELEASE_STATUS_SNAPSHOT, - "OS should be a snapshot"); + g_assert_cmpstr(str, ==, "test4"); + g_assert_cmpint(osinfo_os_get_release_status(os), ==, OSINFO_RELEASE_STATUS_SNAPSHOT); os = osinfo_db_get_os(db, "http://libosinfo.org/test/os/test5"); - fail_unless(os != NULL, "could not find OS 'test5'"); + g_assert_nonnull(os); str = osinfo_product_get_short_id(OSINFO_PRODUCT(os)); - fail_unless(g_strcmp0(str, "test5") == 0, "wrong OS short-id"); + g_assert_cmpstr(str, ==, "test5"); /* 'test5' OS intentionnally contains an invalid release status */ g_test_expect_message(NULL, G_LOG_LEVEL_CRITICAL, "*(osinfo_entity_get_param_value_enum): should not be reached*"); - fail_unless(osinfo_os_get_release_status(os) == OSINFO_RELEASE_STATUS_RELEASED, - "OS should be a released one"); + g_assert_cmpint(osinfo_os_get_release_status(os), ==, OSINFO_RELEASE_STATUS_RELEASED); g_object_unref(loader); } -END_TEST -START_TEST(test_devices_filter) +static void +test_devices_filter(void) { OsinfoOs *os = osinfo_os_new("awesome"); OsinfoDevice *dev1 = osinfo_device_new("e1000"); @@ -154,10 +148,10 @@ START_TEST(test_devices_filter) OsinfoDeviceList *devices = osinfo_os_get_devices(os, filter); - fail_unless(osinfo_list_get_length(OSINFO_LIST(devices)) == 1, "Os has one devices"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(devices)), ==, 1); OsinfoEntity *ent = osinfo_list_get_nth(OSINFO_LIST(devices), 0); - fail_unless(OSINFO_IS_DEVICE(ent), "entity is a device"); - fail_unless(OSINFO_DEVICE(ent) == dev1, "device is e1000"); + g_assert_true(OSINFO_IS_DEVICE(ent)); + g_assert_true(OSINFO_DEVICE(ent) == dev1); g_object_unref(devices); g_object_unref(filter); @@ -165,10 +159,10 @@ START_TEST(test_devices_filter) g_object_unref(dev2); g_object_unref(os); } -END_TEST -START_TEST(test_device_driver) +static void +test_device_driver(void) { OsinfoOs *os = osinfo_os_new("awesome"); OsinfoDevice *dev1 = osinfo_device_new("e1000"); @@ -193,28 +187,18 @@ START_TEST(test_device_driver) g_object_unref(dev2); g_object_unref(os); } -END_TEST -static Suite * -os_suite(void) +int +main(int argc, char *argv[]) { - Suite *s = suite_create("Os"); - TCase *tc = tcase_create("Core"); - tcase_add_test(tc, test_basic); - tcase_add_test(tc, test_loader); - tcase_add_test(tc, test_devices); - tcase_add_test(tc, test_devices_filter); - tcase_add_test(tc, test_device_driver); - suite_add_tcase(s, tc); - return s; -} + g_test_init(&argc, &argv, NULL); -int main(void) -{ - int number_failed; - Suite *s = os_suite(); - SRunner *sr = srunner_create(s); + g_test_add_func("/os/basic", test_basic); + g_test_add_func("/os/loader", test_loader); + g_test_add_func("/os/devices", test_devices); + g_test_add_func("/os/devices_filter", test_devices_filter); + g_test_add_func("/os/device_driver", test_device_driver); /* Make sure we catch unexpected g_warning() */ g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); @@ -227,11 +211,7 @@ int main(void) osinfo_devicelist_get_type(); osinfo_filter_get_type(); - srunner_run_all(sr, CK_ENV); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); - - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return g_test_run(); } /* * Local variables: diff --git a/tests/test-oslist.c b/tests/test-oslist.c index 22ff83b..c85f822 100644 --- a/tests/test-oslist.c +++ b/tests/test-oslist.c @@ -21,12 +21,11 @@ #include -#include #include -#include -START_TEST(test_union) +static void +test_union(void) { OsinfoOsList *list1 = osinfo_oslist_new(); OsinfoOsList *list2 = osinfo_oslist_new(); @@ -45,7 +44,7 @@ START_TEST(test_union) list3 = OSINFO_OSLIST(osinfo_list_new_union(OSINFO_LIST(list1), OSINFO_LIST(list2))); - fail_unless(osinfo_list_get_length(OSINFO_LIST(list3)) == 4, "List did not have 4 elements"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(list3)), ==, 4); gboolean has1 = FALSE; gboolean has2 = FALSE; @@ -66,11 +65,11 @@ START_TEST(test_union) else hasBad = TRUE; } - fail_unless(has1, "List was missing entity 1"); - fail_unless(has2, "List was missing entity 2"); - fail_unless(has3, "List was missing entity 3"); - fail_unless(has4, "List was missing entity 4"); - fail_unless(!hasBad, "List had unexpected entity"); + g_assert_true(has1); + g_assert_true(has2); + g_assert_true(has3); + g_assert_true(has4); + g_assert_false(hasBad); g_object_unref(ent1); g_object_unref(ent2); @@ -80,10 +79,10 @@ START_TEST(test_union) g_object_unref(list2); g_object_unref(list3); } -END_TEST -START_TEST(test_intersect) +static void +test_intersect(void) { OsinfoOsList *list1 = osinfo_oslist_new(); OsinfoOsList *list2 = osinfo_oslist_new(); @@ -104,7 +103,7 @@ START_TEST(test_intersect) list3 = OSINFO_OSLIST(osinfo_list_new_intersection(OSINFO_LIST(list1), OSINFO_LIST(list2))); - fail_unless(osinfo_list_get_length(OSINFO_LIST(list3)) == 2, "List did not have 2 elements"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(list3)), ==, 2); gboolean has1 = FALSE; gboolean has2 = FALSE; @@ -125,11 +124,11 @@ START_TEST(test_intersect) else hasBad = TRUE; } - fail_unless(has1, "List was missing entity 1"); - fail_unless(!has2, "List had unexpected entity 2"); - fail_unless(has3, "List was missing entity 3"); - fail_unless(!has4, "List had unexpected entity 4"); - fail_unless(!hasBad, "List had unexpected entity"); + g_assert_true(has1); + g_assert_false(has2); + g_assert_true(has3); + g_assert_false(has4); + g_assert_false(hasBad); g_object_unref(ent1); g_object_unref(ent2); @@ -139,10 +138,10 @@ START_TEST(test_intersect) g_object_unref(list2); g_object_unref(list3); } -END_TEST -START_TEST(test_filter) +static void +test_filter(void) { OsinfoOsList *list1 = osinfo_oslist_new(); OsinfoOsList *list2; @@ -168,7 +167,7 @@ START_TEST(test_filter) list2 = OSINFO_OSLIST(osinfo_list_new_filtered(OSINFO_LIST(list1), filter)); - fail_unless(osinfo_list_get_length(OSINFO_LIST(list2)) == 3, "List did not have 3 elements"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(list2)), ==, 3); gboolean has1 = FALSE; gboolean has2 = FALSE; @@ -189,11 +188,11 @@ START_TEST(test_filter) else hasBad = TRUE; } - fail_unless(has1, "List was missing entity 1"); - fail_unless(has2, "List was missing entity 2"); - fail_unless(has3, "List was missing entity 3"); - fail_unless(!has4, "List had unexpected entity 4"); - fail_unless(!hasBad, "List had unexpected entity"); + g_assert_true(has1); + g_assert_true(has2); + g_assert_true(has3); + g_assert_false(has4); + g_assert_false(hasBad); g_object_unref(ent1); g_object_unref(ent2); @@ -203,26 +202,16 @@ START_TEST(test_filter) g_object_unref(list1); g_object_unref(list2); } -END_TEST -static Suite * -list_suite(void) +int +main(int argc, char *argv[]) { - Suite *s = suite_create("List"); - TCase *tc = tcase_create("Core"); - tcase_add_test(tc, test_union); - tcase_add_test(tc, test_intersect); - tcase_add_test(tc, test_filter); - suite_add_tcase(s, tc); - return s; -} + g_test_init(&argc, &argv, NULL); -int main(void) -{ - int number_failed; - Suite *s = list_suite(); - SRunner *sr = srunner_create(s); + g_test_add_func("/oslist/union", test_union); + g_test_add_func("/oslist/intersect", test_intersect); + g_test_add_func("/oslist/filter", test_filter); /* Make sure we catch unexpected g_warning() */ g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); @@ -232,11 +221,7 @@ int main(void) osinfo_oslist_get_type(); osinfo_filter_get_type(); - srunner_run_all(sr, CK_ENV); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); - - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return g_test_run(); } /* * Local variables: diff --git a/tests/test-platform.c b/tests/test-platform.c index 8a49983..a518529 100644 --- a/tests/test-platform.c +++ b/tests/test-platform.c @@ -21,24 +21,23 @@ #include -#include #include -#include -START_TEST(test_basic) +static void +test_basic(void) { OsinfoPlatform *platform = osinfo_platform_new("awesome"); - fail_unless(OSINFO_IS_PLATFORM(platform), "Platform is a platform object"); - fail_unless(g_strcmp0(osinfo_entity_get_id(OSINFO_ENTITY(platform)), "awesome") == 0, "Platform ID was awesome"); + g_assert_true(OSINFO_IS_PLATFORM(platform)); + g_assert_cmpstr(osinfo_entity_get_id(OSINFO_ENTITY(platform)), ==, "awesome"); g_object_unref(platform); } -END_TEST -START_TEST(test_devices) +static void +test_devices(void) { OsinfoPlatform *hv = osinfo_platform_new("awesome"); OsinfoDevice *dev1 = osinfo_device_new("e1000"); @@ -51,7 +50,7 @@ START_TEST(test_devices) OsinfoDeviceList *devices = osinfo_platform_get_devices(hv, NULL); - fail_unless(osinfo_list_get_length(OSINFO_LIST(devices)) == 2, "Platform has two devices"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(devices)), ==, 2); gboolean hasDev1 = FALSE; gboolean hasDev2 = FALSE; @@ -59,7 +58,7 @@ START_TEST(test_devices) int i; for (i = 0; i < osinfo_list_get_length(OSINFO_LIST(devices)); i++) { OsinfoEntity *ent = osinfo_list_get_nth(OSINFO_LIST(devices), i); - fail_unless(OSINFO_IS_DEVICE(ent), "entity is a device"); + g_assert_true(OSINFO_IS_DEVICE(ent)); if (OSINFO_DEVICE(ent) == dev1) hasDev1 = TRUE; else if (OSINFO_DEVICE(ent) == dev2) @@ -67,19 +66,19 @@ START_TEST(test_devices) else hasBad = TRUE; } - fail_unless(hasDev1, "Device 1 is missing"); - fail_unless(hasDev2, "Device 2 is missing"); - fail_unless(!hasBad, "Device was not expected"); + g_assert_true(hasDev1); + g_assert_true(hasDev2); + g_assert_false(hasBad); g_object_unref(devices); g_object_unref(dev1); g_object_unref(dev2); g_object_unref(hv); } -END_TEST -START_TEST(test_devices_filter) +static void +test_devices_filter(void) { OsinfoPlatform *hv = osinfo_platform_new("awesome"); OsinfoDevice *dev1 = osinfo_device_new("e1000"); @@ -98,10 +97,10 @@ START_TEST(test_devices_filter) OsinfoDeviceList *devices = osinfo_platform_get_devices(hv, filter); - fail_unless(osinfo_list_get_length(OSINFO_LIST(devices)) == 1, "Platform has one devices"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(devices)), ==, 1); OsinfoEntity *ent = osinfo_list_get_nth(OSINFO_LIST(devices), 0); - fail_unless(OSINFO_IS_DEVICE(ent), "entity is a device"); - fail_unless(OSINFO_DEVICE(ent) == dev1, "device is e1000"); + g_assert_true(OSINFO_IS_DEVICE(ent)); + g_assert_true(OSINFO_DEVICE(ent) == dev1); g_object_unref(devices); g_object_unref(filter); @@ -109,27 +108,17 @@ START_TEST(test_devices_filter) g_object_unref(dev2); g_object_unref(hv); } -END_TEST -static Suite * -platform_suite(void) +int +main(int argc, char *argv[]) { - Suite *s = suite_create("Platform"); - TCase *tc = tcase_create("Core"); - tcase_add_test(tc, test_basic); - tcase_add_test(tc, test_devices); - tcase_add_test(tc, test_devices_filter); - suite_add_tcase(s, tc); - return s; -} + g_test_init(&argc, &argv, NULL); -int main(void) -{ - int number_failed; - Suite *s = platform_suite(); - SRunner *sr = srunner_create(s); + g_test_add_func("/platform/basic", test_basic); + g_test_add_func("/platform/devices", test_devices); + g_test_add_func("/platform/devices_filter", test_devices_filter); /* Make sure we catch unexpected g_warning() */ g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); @@ -140,11 +129,7 @@ int main(void) osinfo_devicelist_get_type(); osinfo_filter_get_type(); - srunner_run_all(sr, CK_ENV); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); - - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return g_test_run(); } /* * Local variables: diff --git a/tests/test-platformlist.c b/tests/test-platformlist.c index 0310050..f502911 100644 --- a/tests/test-platformlist.c +++ b/tests/test-platformlist.c @@ -21,12 +21,11 @@ #include -#include #include -#include -START_TEST(test_union) +static void +test_union(void) { OsinfoPlatformList *list1 = osinfo_platformlist_new(); OsinfoPlatformList *list2 = osinfo_platformlist_new(); @@ -45,7 +44,7 @@ START_TEST(test_union) list3 = OSINFO_PLATFORMLIST(osinfo_list_new_union(OSINFO_LIST(list1), OSINFO_LIST(list2))); - fail_unless(osinfo_list_get_length(OSINFO_LIST(list3)) == 4, "List did not have 4 elements"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(list3)), ==, 4); gboolean has1 = FALSE; gboolean has2 = FALSE; @@ -66,11 +65,11 @@ START_TEST(test_union) else hasBad = TRUE; } - fail_unless(has1, "List was missing entity 1"); - fail_unless(has2, "List was missing entity 2"); - fail_unless(has3, "List was missing entity 3"); - fail_unless(has4, "List was missing entity 4"); - fail_unless(!hasBad, "List had unexpected entity"); + g_assert_true(has1); + g_assert_true(has2); + g_assert_true(has3); + g_assert_true(has4); + g_assert_false(hasBad); g_object_unref(ent1); g_object_unref(ent2); @@ -80,10 +79,10 @@ START_TEST(test_union) g_object_unref(list2); g_object_unref(list3); } -END_TEST -START_TEST(test_intersect) +static void +test_intersect(void) { OsinfoPlatformList *list1 = osinfo_platformlist_new(); OsinfoPlatformList *list2 = osinfo_platformlist_new(); @@ -104,7 +103,7 @@ START_TEST(test_intersect) list3 = OSINFO_PLATFORMLIST(osinfo_list_new_intersection(OSINFO_LIST(list1), OSINFO_LIST(list2))); - fail_unless(osinfo_list_get_length(OSINFO_LIST(list3)) == 2, "List did not have 2 elements"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(list3)), ==, 2); gboolean has1 = FALSE; gboolean has2 = FALSE; @@ -125,11 +124,11 @@ START_TEST(test_intersect) else hasBad = TRUE; } - fail_unless(has1, "List was missing entity 1"); - fail_unless(!has2, "List had unexpected entity 2"); - fail_unless(has3, "List was missing entity 3"); - fail_unless(!has4, "List had unexpected entity 4"); - fail_unless(!hasBad, "List had unexpected entity"); + g_assert_true(has1); + g_assert_false(has2); + g_assert_true(has3); + g_assert_false(has4); + g_assert_false(hasBad); g_object_unref(ent1); g_object_unref(ent2); @@ -139,10 +138,10 @@ START_TEST(test_intersect) g_object_unref(list2); g_object_unref(list3); } -END_TEST -START_TEST(test_filter) +static void +test_filter(void) { OsinfoPlatformList *list1 = osinfo_platformlist_new(); OsinfoPlatformList *list2; @@ -168,7 +167,7 @@ START_TEST(test_filter) list2 = OSINFO_PLATFORMLIST(osinfo_list_new_filtered(OSINFO_LIST(list1), filter)); - fail_unless(osinfo_list_get_length(OSINFO_LIST(list2)) == 3, "List did not have 3 elements"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(list2)), ==, 3); gboolean has1 = FALSE; gboolean has2 = FALSE; @@ -189,11 +188,11 @@ START_TEST(test_filter) else hasBad = TRUE; } - fail_unless(has1, "List was missing entity 1"); - fail_unless(has2, "List was missing entity 2"); - fail_unless(has3, "List was missing entity 3"); - fail_unless(!has4, "List had unexpected entity 4"); - fail_unless(!hasBad, "List had unexpected entity"); + g_assert_true(has1); + g_assert_true(has2); + g_assert_true(has3); + g_assert_false(has4); + g_assert_false(hasBad); g_object_unref(ent1); g_object_unref(ent2); @@ -203,26 +202,16 @@ START_TEST(test_filter) g_object_unref(list1); g_object_unref(list2); } -END_TEST -static Suite * -list_suite(void) +int +main(int argc, char *argv[]) { - Suite *s = suite_create("List"); - TCase *tc = tcase_create("Core"); - tcase_add_test(tc, test_union); - tcase_add_test(tc, test_intersect); - tcase_add_test(tc, test_filter); - suite_add_tcase(s, tc); - return s; -} + g_test_init(&argc, &argv, NULL); -int main(void) -{ - int number_failed; - Suite *s = list_suite(); - SRunner *sr = srunner_create(s); + g_test_add_func("/platformlist/union", test_union); + g_test_add_func("/platformlist/intersect", test_intersect); + g_test_add_func("/platformlist/filter", test_filter); /* Make sure we catch unexpected g_warning() */ g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); @@ -232,11 +221,7 @@ int main(void) osinfo_platformlist_get_type(); osinfo_filter_get_type(); - srunner_run_all(sr, CK_ENV); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); - - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return g_test_run(); } /* * Local variables: diff --git a/tests/test-product.c b/tests/test-product.c index f9ddb12..8d58f1c 100644 --- a/tests/test-product.c +++ b/tests/test-product.c @@ -21,9 +21,7 @@ #include -#include #include -#include /* OsinfoProduct is abstract, so we need to trivially subclass it to test it */ typedef struct _OsinfoDummy OsinfoDummy; @@ -51,19 +49,20 @@ static OsinfoProduct *osinfo_dummy_new(const gchar *id) { } -START_TEST(test_basic) +static void +test_basic(void) { OsinfoProduct *product = osinfo_dummy_new("pony"); - fail_unless(OSINFO_IS_PRODUCT(product), "Product is a product object"); - fail_unless(g_strcmp0(osinfo_entity_get_id(OSINFO_ENTITY(product)), "pony") == 0, "Product ID was pony"); + g_assert_true(OSINFO_IS_PRODUCT(product)); + g_assert_cmpstr(osinfo_entity_get_id(OSINFO_ENTITY(product)), ==, "pony"); g_object_unref(product); } -END_TEST -START_TEST(test_relproduct) +static void +test_relproduct(void) { OsinfoProduct *product1 = osinfo_dummy_new("pony"); OsinfoProduct *product2 = osinfo_dummy_new("donkey"); @@ -78,27 +77,26 @@ START_TEST(test_relproduct) osinfo_product_add_related(product1, OSINFO_PRODUCT_RELATIONSHIP_CLONES, product5); OsinfoProductList *product1rel = osinfo_product_get_related(product1, OSINFO_PRODUCT_RELATIONSHIP_DERIVES_FROM); - fail_unless(osinfo_list_get_length(OSINFO_LIST(product1rel)) == 1, "Product has 1 derived product"); - fail_unless(osinfo_list_get_nth(OSINFO_LIST(product1rel), 0) == OSINFO_ENTITY(product2), "derived product is product2"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(product1rel)), ==, 1); + g_assert_true(osinfo_list_get_nth(OSINFO_LIST(product1rel), 0) == OSINFO_ENTITY(product2)); g_object_unref(product1rel); product1rel = osinfo_product_get_related(product1, OSINFO_PRODUCT_RELATIONSHIP_UPGRADES); - fail_unless(osinfo_list_get_length(OSINFO_LIST(product1rel)) == 2, "Product has 2 upgraded product"); - fail_unless((osinfo_list_get_nth(OSINFO_LIST(product1rel), 0) == OSINFO_ENTITY(product3) || - osinfo_list_get_nth(OSINFO_LIST(product1rel), 0) == OSINFO_ENTITY(product4)) && - (osinfo_list_get_nth(OSINFO_LIST(product1rel), 1) == OSINFO_ENTITY(product3) || - osinfo_list_get_nth(OSINFO_LIST(product1rel), 1) == OSINFO_ENTITY(product4)), - "upgraded productes are product3 + product4"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(product1rel)), ==, 2); + g_assert_true((osinfo_list_get_nth(OSINFO_LIST(product1rel), 0) == OSINFO_ENTITY(product3) || + osinfo_list_get_nth(OSINFO_LIST(product1rel), 0) == OSINFO_ENTITY(product4)) && + (osinfo_list_get_nth(OSINFO_LIST(product1rel), 1) == OSINFO_ENTITY(product3) || + osinfo_list_get_nth(OSINFO_LIST(product1rel), 1) == OSINFO_ENTITY(product4))); g_object_unref(product1rel); product1rel = osinfo_product_get_related(product3, OSINFO_PRODUCT_RELATIONSHIP_UPGRADES); - fail_unless(osinfo_list_get_length(OSINFO_LIST(product1rel)) == 1, "Product has 1 upgraded product"); - fail_unless(osinfo_list_get_nth(OSINFO_LIST(product1rel), 0) == OSINFO_ENTITY(product4), "upgraded product is product4"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(product1rel)), ==, 1); + g_assert_true(osinfo_list_get_nth(OSINFO_LIST(product1rel), 0) == OSINFO_ENTITY(product4)); g_object_unref(product1rel); product1rel = osinfo_product_get_related(product1, OSINFO_PRODUCT_RELATIONSHIP_CLONES); - fail_unless(osinfo_list_get_length(OSINFO_LIST(product1rel)) == 1, "Product has 1 upgraded product"); - fail_unless(osinfo_list_get_nth(OSINFO_LIST(product1rel), 0) == OSINFO_ENTITY(product5), "cloned product is product5"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(product1rel)), ==, 1); + g_assert_true(osinfo_list_get_nth(OSINFO_LIST(product1rel), 0) == OSINFO_ENTITY(product5)); g_object_unref(product1rel); g_object_unref(product1); @@ -107,11 +105,11 @@ START_TEST(test_relproduct) g_object_unref(product4); g_object_unref(product5); } -END_TEST -START_TEST(test_supportdate) +static void +test_supportdate(void) { OsinfoProductList *products = osinfo_productlist_new(); OsinfoProduct *product1 = osinfo_dummy_new("pony"); @@ -138,9 +136,9 @@ START_TEST(test_supportdate) date = g_date_new_dmy(31, 12, 1999); osinfo_productfilter_add_support_date_constraint(filter, date); tmp = OSINFO_PRODUCTLIST(osinfo_list_new_filtered(OSINFO_LIST(products), OSINFO_FILTER(filter))); - fail_unless(osinfo_list_get_length(OSINFO_LIST(tmp)) == 2, "2 products"); - fail_unless(osinfo_list_get_nth(OSINFO_LIST(tmp), 0) == (OsinfoEntity*)product1, "Got product 1"); - fail_unless(osinfo_list_get_nth(OSINFO_LIST(tmp), 1) == (OsinfoEntity*)product3, "Got product 3"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(tmp)), ==, 2); + g_assert_true(osinfo_list_get_nth(OSINFO_LIST(tmp), 0) == (OsinfoEntity*)product1); + g_assert_true(osinfo_list_get_nth(OSINFO_LIST(tmp), 1) == (OsinfoEntity*)product3); g_object_unref(tmp); g_date_free(date); @@ -148,10 +146,10 @@ START_TEST(test_supportdate) date = g_date_new_dmy(01, 01, 2000); osinfo_productfilter_add_support_date_constraint(filter, date); tmp = OSINFO_PRODUCTLIST(osinfo_list_new_filtered(OSINFO_LIST(products), OSINFO_FILTER(filter))); - fail_unless(osinfo_list_get_length(OSINFO_LIST(tmp)) == 3, "3 products"); - fail_unless(osinfo_list_get_nth(OSINFO_LIST(tmp), 0) == (OsinfoEntity*)product1, "Got product 1"); - fail_unless(osinfo_list_get_nth(OSINFO_LIST(tmp), 1) == (OsinfoEntity*)product2, "Got product 2"); - fail_unless(osinfo_list_get_nth(OSINFO_LIST(tmp), 2) == (OsinfoEntity*)product3, "Got product 3"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(tmp)), ==, 3); + g_assert_true(osinfo_list_get_nth(OSINFO_LIST(tmp), 0) == (OsinfoEntity*)product1); + g_assert_true(osinfo_list_get_nth(OSINFO_LIST(tmp), 1) == (OsinfoEntity*)product2); + g_assert_true(osinfo_list_get_nth(OSINFO_LIST(tmp), 2) == (OsinfoEntity*)product3); g_object_unref(tmp); g_date_free(date); @@ -159,10 +157,10 @@ START_TEST(test_supportdate) date = g_date_new_dmy(01, 01, 2010); osinfo_productfilter_add_support_date_constraint(filter, date); tmp = OSINFO_PRODUCTLIST(osinfo_list_new_filtered(OSINFO_LIST(products), OSINFO_FILTER(filter))); - fail_unless(osinfo_list_get_length(OSINFO_LIST(tmp)) == 3, "3 products"); - fail_unless(osinfo_list_get_nth(OSINFO_LIST(tmp), 0) == (OsinfoEntity*)product1, "Got product 1"); - fail_unless(osinfo_list_get_nth(OSINFO_LIST(tmp), 1) == (OsinfoEntity*)product2, "Got product 2"); - fail_unless(osinfo_list_get_nth(OSINFO_LIST(tmp), 2) == (OsinfoEntity*)product3, "Got product 3"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(tmp)), ==, 3); + g_assert_true(osinfo_list_get_nth(OSINFO_LIST(tmp), 0) == (OsinfoEntity*)product1); + g_assert_true(osinfo_list_get_nth(OSINFO_LIST(tmp), 1) == (OsinfoEntity*)product2); + g_assert_true(osinfo_list_get_nth(OSINFO_LIST(tmp), 2) == (OsinfoEntity*)product3); g_object_unref(tmp); g_date_free(date); @@ -170,11 +168,11 @@ START_TEST(test_supportdate) date = g_date_new_dmy(01, 05, 2005); osinfo_productfilter_add_support_date_constraint(filter, date); tmp = OSINFO_PRODUCTLIST(osinfo_list_new_filtered(OSINFO_LIST(products), OSINFO_FILTER(filter))); - fail_unless(osinfo_list_get_length(OSINFO_LIST(tmp)) == 4, "4 products"); - fail_unless(osinfo_list_get_nth(OSINFO_LIST(tmp), 0) == (OsinfoEntity*)product1, "Got product 1"); - fail_unless(osinfo_list_get_nth(OSINFO_LIST(tmp), 1) == (OsinfoEntity*)product2, "Got product 2"); - fail_unless(osinfo_list_get_nth(OSINFO_LIST(tmp), 2) == (OsinfoEntity*)product3, "Got product 3"); - fail_unless(osinfo_list_get_nth(OSINFO_LIST(tmp), 3) == (OsinfoEntity*)product4, "Got product 4"); + g_assert_cmpint(osinfo_list_get_length(OSINFO_LIST(tmp)), ==, 4); + g_assert_true(osinfo_list_get_nth(OSINFO_LIST(tmp), 0) == (OsinfoEntity*)product1); + g_assert_true(osinfo_list_get_nth(OSINFO_LIST(tmp), 1) == (OsinfoEntity*)product2); + g_assert_true(osinfo_list_get_nth(OSINFO_LIST(tmp), 2) == (OsinfoEntity*)product3); + g_assert_true(osinfo_list_get_nth(OSINFO_LIST(tmp), 3) == (OsinfoEntity*)product4); g_object_unref(tmp); g_date_free(date); @@ -185,27 +183,17 @@ START_TEST(test_supportdate) g_object_unref(filter); g_object_unref(products); } -END_TEST -static Suite * -product_suite(void) +int +main(int argc, char *argv[]) { - Suite *s = suite_create("Product"); - TCase *tc = tcase_create("Core"); - tcase_add_test(tc, test_basic); - tcase_add_test(tc, test_relproduct); - tcase_add_test(tc, test_supportdate); - suite_add_tcase(s, tc); - return s; -} + g_test_init(&argc, &argv, NULL); -int main(void) -{ - int number_failed; - Suite *s = product_suite(); - SRunner *sr = srunner_create(s); + g_test_add_func("/product/basic", test_basic); + g_test_add_func("/product/relproduct", test_relproduct); + g_test_add_func("/product/supportdate", test_supportdate); /* Make sure we catch unexpected g_warning() */ g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); @@ -218,11 +206,7 @@ int main(void) osinfo_devicelist_get_type(); osinfo_filter_get_type(); - srunner_run_all(sr, CK_ENV); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); - - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return g_test_run(); } /* * Local variables: diff --git a/tests/test-productfilter.c b/tests/test-productfilter.c index 239e1a4..021e45a 100644 --- a/tests/test-productfilter.c +++ b/tests/test-productfilter.c @@ -21,9 +21,7 @@ #include -#include #include -#include /* OsinfoProduct is abstract, so we need to trivially subclass it to test it */ typedef struct _OsinfoDummy OsinfoDummy; @@ -51,62 +49,63 @@ static OsinfoProduct *osinfo_dummy_new(const gchar *id) { } -START_TEST(test_basic) +static void +test_basic(void) { OsinfoProductFilter *productfilter = osinfo_productfilter_new(); OsinfoProduct *product1 = osinfo_dummy_new("pretty"); OsinfoProduct *product2 = osinfo_dummy_new("ugly"); - fail_unless(OSINFO_IS_PRODUCTFILTER(productfilter), "ProductFilter is a productfilter object"); - fail_unless(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product1)), "ProductFilter matches PRODUCT"); + g_assert_true(OSINFO_IS_PRODUCTFILTER(productfilter)); + g_assert_true(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product1))); osinfo_productfilter_add_product_constraint(productfilter, OSINFO_PRODUCT_RELATIONSHIP_DERIVES_FROM, product1); GList *tmp = osinfo_productfilter_get_product_constraint_values(productfilter, OSINFO_PRODUCT_RELATIONSHIP_DERIVES_FROM); - fail_unless(tmp != NULL, "Unexpected missing PRODUCT"); - fail_unless(tmp->data == product1, "Derived PRODUCT is PRODUCT 1"); - fail_unless(tmp->next == NULL, "Too many derived PRODUCT"); + g_assert_nonnull(tmp); + g_assert_true(tmp->data == product1); + g_assert_null(tmp->next); g_list_free(tmp); tmp = osinfo_productfilter_get_product_constraint_values(productfilter, OSINFO_PRODUCT_RELATIONSHIP_CLONES); - fail_unless(tmp == NULL, "Unexpected cloned PRODUCT"); + g_assert_null(tmp); osinfo_productfilter_add_product_constraint(productfilter, OSINFO_PRODUCT_RELATIONSHIP_DERIVES_FROM, product2); tmp = osinfo_productfilter_get_product_constraint_values(productfilter, OSINFO_PRODUCT_RELATIONSHIP_DERIVES_FROM); - fail_unless(tmp != NULL, "Unexpected missing PRODUCT"); - fail_unless(tmp->data == product2, "Derived PRODUCT is PRODUCT 1"); - fail_unless(tmp->next != NULL, "Not enough derived PRODUCT"); - fail_unless(tmp->next->data == product1, "Derived PRODUCT is PRODUCT 1"); - fail_unless(tmp->next->next == NULL, "Too many derived PRODUCT"); + g_assert_nonnull(tmp); + g_assert_true(tmp->data == product2); + g_assert_nonnull(tmp->next); + g_assert_true(tmp->next->data == product1); + g_assert_null(tmp->next->next); g_list_free(tmp); osinfo_productfilter_add_product_constraint(productfilter, OSINFO_PRODUCT_RELATIONSHIP_UPGRADES, product1); tmp = osinfo_productfilter_get_product_constraint_values(productfilter, OSINFO_PRODUCT_RELATIONSHIP_UPGRADES); - fail_unless(tmp != NULL, "Unexpected missing PRODUCT"); - fail_unless(tmp->data == product1, "Derived PRODUCT is PRODUCT 1"); - fail_unless(tmp->next == NULL, "Too many derived PRODUCT"); + g_assert_nonnull(tmp); + g_assert_true(tmp->data == product1); + g_assert_null(tmp->next); g_list_free(tmp); osinfo_productfilter_add_product_constraint(productfilter, OSINFO_PRODUCT_RELATIONSHIP_CLONES, product1); tmp = osinfo_productfilter_get_product_constraint_values(productfilter, OSINFO_PRODUCT_RELATIONSHIP_CLONES); - fail_unless(tmp != NULL, "Unexpected missing PRODUCT"); - fail_unless(tmp->data == product1, "Derived PRODUCT is PRODUCT 1"); - fail_unless(tmp->next == NULL, "Too many derived PRODUCT"); + g_assert_nonnull(tmp); + g_assert_true(tmp->data == product1); + g_assert_null(tmp->next); g_list_free(tmp); g_object_unref(product2); g_object_unref(product1); g_object_unref(productfilter); } -END_TEST -START_TEST(test_productfilter_single) +static void +test_productfilter_single(void) { OsinfoProductFilter *productfilter = osinfo_productfilter_new(); OsinfoProduct *product1 = osinfo_dummy_new("hot"); @@ -119,10 +118,10 @@ START_TEST(test_productfilter_single) osinfo_product_add_related(product3, OSINFO_PRODUCT_RELATIONSHIP_DERIVES_FROM, product4); osinfo_productfilter_add_product_constraint(productfilter, OSINFO_PRODUCT_RELATIONSHIP_DERIVES_FROM, product2); - fail_unless(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product1)), "Filter matches PRODUCT 1"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product2)), "Filter does not match PRODUCT 2"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product3)), "Filter does not match PRODUCT 3"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product4)), "Filter does not match PRODUCT 4"); + g_assert_true(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product1))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product2))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product3))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product4))); g_object_unref(product1); g_object_unref(product2); @@ -130,10 +129,10 @@ START_TEST(test_productfilter_single) g_object_unref(product4); g_object_unref(productfilter); } -END_TEST -START_TEST(test_productfilter_multi) +static void +test_productfilter_multi(void) { OsinfoProductFilter *productfilter = osinfo_productfilter_new(); OsinfoProduct *product1 = osinfo_dummy_new("hot"); @@ -150,28 +149,28 @@ START_TEST(test_productfilter_multi) osinfo_productfilter_add_product_constraint(productfilter, OSINFO_PRODUCT_RELATIONSHIP_DERIVES_FROM, product2); osinfo_productfilter_add_product_constraint(productfilter, OSINFO_PRODUCT_RELATIONSHIP_CLONES, product5); - fail_unless(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product1)), "Filter matches PRODUCT 1"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product2)), "Filter does not match PRODUCT 2"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product3)), "Filter does not match PRODUCT 3"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product4)), "Filter does not match PRODUCT 4"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product5)), "Filter does not match PRODUCT 5"); + g_assert_true(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product1))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product2))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product3))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product4))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product5))); osinfo_productfilter_clear_product_constraint(productfilter, OSINFO_PRODUCT_RELATIONSHIP_CLONES); - fail_unless(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product1)), "Filter matches PRODUCT 1"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product2)), "Filter does not match PRODUCT 2"); - fail_unless(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product3)), "Filter matches PRODUCT 3"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product4)), "Filter does not match PRODUCT 4"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product5)), "Filter does not match PRODUCT 5"); + g_assert_true(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product1))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product2))); + g_assert_true(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product3))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product4))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product5))); osinfo_productfilter_clear_product_constraints(productfilter); osinfo_productfilter_add_product_constraint(productfilter, OSINFO_PRODUCT_RELATIONSHIP_UPGRADES, product5); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product1)), "Filter does not match PRODUCT 1"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product2)), "Filter does not match PRODUCT 2"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product3)), "Filter does not match PRODUCT 3"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product4)), "Filter does not match PRODUCT 4"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product5)), "Filter does not match PRODUCT 5"); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product1))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product2))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product3))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product4))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product5))); g_object_unref(product1); g_object_unref(product2); @@ -180,10 +179,10 @@ START_TEST(test_productfilter_multi) g_object_unref(product5); g_object_unref(productfilter); } -END_TEST -START_TEST(test_productfilter_combine) +static void +test_productfilter_combine(void) { OsinfoProductFilter *productfilter = osinfo_productfilter_new(); OsinfoProduct *product1 = osinfo_dummy_new("hot"); @@ -198,22 +197,22 @@ START_TEST(test_productfilter_combine) osinfo_entity_add_param(OSINFO_ENTITY(product3), "vendor", "acme"); osinfo_productfilter_add_product_constraint(productfilter, OSINFO_PRODUCT_RELATIONSHIP_DERIVES_FROM, product2); - fail_unless(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product1)), "Filter matches PRODUCT 1"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product2)), "Filter does not match PRODUCT 2"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product3)), "Filter does not match PRODUCT 3"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product4)), "Filter does not match PRODUCT 4"); + g_assert_true(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product1))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product2))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product3))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product4))); osinfo_filter_add_constraint(OSINFO_FILTER(productfilter), "vendor", "acme"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product1)), "Filter does not match PRODUCT 1"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product2)), "Filter does not match PRODUCT 2"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product3)), "Filter does not match PRODUCT 3"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product4)), "Filter does not match PRODUCT 4"); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product1))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product2))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product3))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product4))); osinfo_productfilter_clear_product_constraint(productfilter, OSINFO_PRODUCT_RELATIONSHIP_DERIVES_FROM); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product1)), "Filter does not match PRODUCT 1"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product2)), "Filter does not match PRODUCT 2"); - fail_unless(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product3)), "Filter matches PRODUCT 3"); - fail_unless(!osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product4)), "Filter does not match PRODUCT 4"); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product1))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product2))); + g_assert_true(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product3))); + g_assert_false(osinfo_filter_matches(OSINFO_FILTER(productfilter), OSINFO_ENTITY(product4))); g_object_unref(product1); g_object_unref(product2); @@ -221,27 +220,17 @@ START_TEST(test_productfilter_combine) g_object_unref(product4); g_object_unref(productfilter); } -END_TEST -static Suite * -productfilter_suite(void) +int +main(int argc, char *argv[]) { - Suite *s = suite_create("ProductFilter"); - TCase *tc = tcase_create("Core"); - tcase_add_test(tc, test_basic); - tcase_add_test(tc, test_productfilter_single); - tcase_add_test(tc, test_productfilter_multi); - tcase_add_test(tc, test_productfilter_combine); - suite_add_tcase(s, tc); - return s; -} + g_test_init(&argc, &argv, NULL); -int main(void) -{ - int number_failed; - Suite *s = productfilter_suite(); - SRunner *sr = srunner_create(s); + g_test_add_func("/productfilter/basic", test_basic); + g_test_add_func("/productfilter/productfilter_single", test_productfilter_single); + g_test_add_func("/productfilter/productfilter_multi", test_productfilter_multi); + g_test_add_func("/productfilter/productfilter_combine", test_productfilter_combine); /* Make sure we catch unexpected g_warning() */ g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); @@ -254,11 +243,7 @@ int main(void) osinfo_productfilter_get_type(); osinfo_product_get_type(); - srunner_run_all(sr, CK_ENV); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); - - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return g_test_run(); } /* * Local variables: diff --git a/tests/test-treeuris.c b/tests/test-treeuris.c index defe3a7..e4bcdcc 100644 --- a/tests/test-treeuris.c +++ b/tests/test-treeuris.c @@ -21,10 +21,8 @@ #include -#include #include #include -#include #include static void test_tree(OsinfoTreeList *treelist, GError **error, CURL *curl) @@ -43,14 +41,15 @@ static void test_tree(OsinfoTreeList *treelist, GError **error, CURL *curl) continue; } - g_print("%s\n", url); + g_test_message("%s", url); curl_easy_setopt(curl, CURLOPT_URL, url); res = curl_easy_perform(curl); if (res != CURLE_OK) { curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code); } - fail_unless(res == CURLE_OK, "Failed HEAD (res=%d, %s; code=%ld) on %s", res, curl_easy_strerror(res), response_code, url); + g_test_message("res=%d, %s; code=%ld", res, curl_easy_strerror(res), response_code); + g_assert_cmpint(res, ==, CURLE_OK); tmp = tmp->next; } @@ -58,7 +57,8 @@ static void test_tree(OsinfoTreeList *treelist, GError **error, CURL *curl) g_list_free(treeel); } -START_TEST(test_uris) +static void +test_uris(void) { CURL *curl; OsinfoLoader *loader = osinfo_loader_new(); @@ -81,11 +81,11 @@ START_TEST(test_uris) curl_easy_setopt(curl, CURLOPT_VERBOSE, debug_level > 0 ? 1L : 0L); } - fail_unless(OSINFO_IS_LOADER(loader), "Loader is not a LOADER"); - fail_unless(OSINFO_IS_DB(db), "Db is not a DB"); + g_assert_true(OSINFO_IS_LOADER(loader)); + g_assert_true(OSINFO_IS_DB(db)); osinfo_loader_process_default_path(loader, &error); - fail_unless(error == NULL, error ? error->message : "none"); + g_assert_no_error(error); oslist = osinfo_db_get_os_list(db); tmp = osel = osinfo_list_get_elements(OSINFO_LIST(oslist)); @@ -95,7 +95,7 @@ START_TEST(test_uris) test_tree(treelist, &error, curl); - fail_unless(error == NULL, error ? error->message : "none"); + g_assert_no_error(error); g_object_unref(treelist); tmp = tmp->next; @@ -109,27 +109,17 @@ START_TEST(test_uris) g_object_unref(loader); } -END_TEST -static Suite * -list_suite(void) +int +main(int argc, char *argv[]) { - Suite *s = suite_create("List"); - TCase *tc = tcase_create("Core"); - tcase_set_timeout(tc, 120); + int ret; - tcase_add_test(tc, test_uris); - suite_add_tcase(s, tc); - return s; -} + g_test_init(&argc, &argv, NULL); -int main(void) -{ - int number_failed; - Suite *s = list_suite(); - SRunner *sr = srunner_create(s); + g_test_add_func("/treeuris/uris", test_uris); /* Make sure we catch unexpected g_warning() */ g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); @@ -150,13 +140,11 @@ int main(void) osinfo_oslist_get_type(); osinfo_filter_get_type(); - srunner_run_all(sr, CK_ENV); - number_failed = srunner_ntests_failed(sr); - srunner_free(sr); + ret = g_test_run(); curl_global_cleanup(); - return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; + return ret; } /* * Local variables: -- 2.13.6 From ptoscano at redhat.com Thu Oct 19 13:33:33 2017 From: ptoscano at redhat.com (Pino Toscano) Date: Thu, 19 Oct 2017 15:33:33 +0200 Subject: [Libosinfo] [libosinfo PATCH] tests: convert from check to the GLib testing framework In-Reply-To: <20171019131424.21880-1-ptoscano@redhat.com> References: <20171019131424.21880-1-ptoscano@redhat.com> Message-ID: <7384223.Q1H01s5rLt@thyrus.usersys.redhat.com> On Thursday, 19 October 2017 15:14:24 CEST Pino Toscano wrote: > GLib has shipped a testing framework for many years already, so we can > make use of it, replacing the external "check". > > The conversion only switches framework without changing the structure of > the tests, making use of the more appropriate assertion in the various > places. > > Signed-off-by: Pino Toscano > --- Meh, I suck, I accentally pushed it (see why I did not wanted powers!). Apologies. I can revert it right now, if needed. Otherwise, if there are just small edges to smooth, I can post cleanup patches. Let me know. Sorry again, -- Pino Toscano -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part. URL: From berrange at redhat.com Thu Oct 19 13:36:28 2017 From: berrange at redhat.com (Daniel P. Berrange) Date: Thu, 19 Oct 2017 14:36:28 +0100 Subject: [Libosinfo] [libosinfo PATCH] tests: convert from check to the GLib testing framework In-Reply-To: <20171019131424.21880-1-ptoscano@redhat.com> References: <20171019131424.21880-1-ptoscano@redhat.com> Message-ID: <20171019133628.GP8408@redhat.com> On Thu, Oct 19, 2017 at 03:14:24PM +0200, Pino Toscano wrote: > GLib has shipped a testing framework for many years already, so we can > make use of it, replacing the external "check". > > The conversion only switches framework without changing the structure of > the tests, making use of the more appropriate assertion in the various > places. > > Signed-off-by: Pino Toscano > --- > configure.ac | 1 - > libosinfo.spec.in | 1 - > tests/Makefile.am | 3 +- > tests/test-db.c | 165 +++++++++++++++++-------------------- > tests/test-device.c | 33 ++------ > tests/test-devicelist.c | 77 +++++++---------- > tests/test-entity.c | 195 ++++++++++++++++++++------------------------ > tests/test-filter.c | 111 +++++++++++-------------- > tests/test-install-script.c | 92 ++++++++------------- > tests/test-isodetect.c | 138 ++++++++++++++----------------- > tests/test-list.c | 145 +++++++++++++++----------------- > tests/test-loader.c | 33 ++------ > tests/test-mediauris.c | 44 ++++------ > tests/test-os.c | 122 ++++++++++++--------------- > tests/test-oslist.c | 77 +++++++---------- > tests/test-platform.c | 61 ++++++-------- > tests/test-platformlist.c | 77 +++++++---------- > tests/test-product.c | 100 ++++++++++------------- > tests/test-productfilter.c | 143 +++++++++++++++----------------- > tests/test-treeuris.c | 44 ++++------ > 20 files changed, 694 insertions(+), 968 deletions(-) > > diff --git a/configure.ac b/configure.ac > index 99abe94..d834c89 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -57,7 +57,6 @@ AC_ARG_ENABLE([tests], > > if test "x$enable_tests" != "xno" ; then > have_curl=no > - PKG_CHECK_MODULES([CHECK], [check]) > PKG_CHECK_MODULES([CURL], [libcurl], [have_curl=yes], [:]) > AC_SUBST(CURL_CFLAGS) > AC_SUBST(CURL_LIBS) > diff --git a/libosinfo.spec.in b/libosinfo.spec.in > index 5a5e6f8..f3e3690 100644 > --- a/libosinfo.spec.in > +++ b/libosinfo.spec.in > @@ -11,7 +11,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) > URL: https://libosinfo.org/ > BuildRequires: intltool > BuildRequires: glib2-devel > -BuildRequires: check-devel > BuildRequires: libxml2-devel >= 2.6.0 > BuildRequires: libxslt-devel >= 1.0.0 > BuildRequires: vala > diff --git a/tests/Makefile.am b/tests/Makefile.am > index 9315e04..7566d3c 100644 > --- a/tests/Makefile.am > +++ b/tests/Makefile.am > @@ -30,7 +30,6 @@ COMMON_LDADD = \ > $(COVERAGE_LDFLAGS) \ > $(GLIB_LIBS) \ > $(GOBJECT_LIBS) \ > - $(CHECK_LIBS) \ > ../osinfo/libosinfo-1.0.la > COMMON_CFLAGS = \ > $(WARN_CFLAGS) \ > @@ -40,7 +39,7 @@ COMMON_CFLAGS = \ > -I$(top_srcdir) \ > -DSRCDIR="\"$(abs_top_srcdir)\"" \ > -DBUILDDIR="\"$(abs_top_builddir)\"" \ > - $(CHECK_CFLAGS) > + $(NULL) > > test_entity_LDADD = $(COMMON_LDADD) > test_entity_CFLAGS = $(COMMON_CFLAGS) > diff --git a/tests/test-isodetect.c b/tests/test-isodetect.c > index 7214531..97c86c4 100644 > --- a/tests/test-isodetect.c > +++ b/tests/test-isodetect.c > -int main(void) > -{ > - int number_failed; > - Suite *s = list_suite(); > - SRunner *sr = srunner_create(s); > + g_test_init(&argc, &argv, NULL); > + > + g_test_add_func("/isodetect/fedora", test_fedora); > + g_test_add_func("/isodetect/rhel", test_rhel); > + g_test_add_func("/isodetect/ubuntu", test_ubuntu); > + g_test_add_func("/isodetect/debian", test_debian); > + g_test_add_func("/isodetect/windows", test_windows); > + g_test_add_func("/isodetect/freebsd", test_freebsd); > + g_test_add_func("/isodetect/openbsd", test_openbsd); > + g_test_add_func("/isodetect/opensuse", test_opensuse); > + g_test_add_func("/isodetect/centos", test_centos); > + g_test_add_func("/isodetect/gnome", test_gnome); > + g_test_add_func("/isodetect/altlinux", test_altlinux); > + g_test_add_func("/isodetect/mageia", test_mageia); > + g_test_add_func("/isodetect/sles", test_sles); > + g_test_add_func("/isodetect/sled", test_sled); We could wrap all of this in a if (g_test_slow()) { .... } so that this only executes if people request slow tests via '-m slow' arg Regardless, fine to push as is Reviewed-by: Daniel P. Berrange 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 :| From berrange at redhat.com Thu Oct 19 13:36:55 2017 From: berrange at redhat.com (Daniel P. Berrange) Date: Thu, 19 Oct 2017 14:36:55 +0100 Subject: [Libosinfo] [libosinfo PATCH] tests: convert from check to the GLib testing framework In-Reply-To: <7384223.Q1H01s5rLt@thyrus.usersys.redhat.com> References: <20171019131424.21880-1-ptoscano@redhat.com> <7384223.Q1H01s5rLt@thyrus.usersys.redhat.com> Message-ID: <20171019133655.GQ8408@redhat.com> On Thu, Oct 19, 2017 at 03:33:33PM +0200, Pino Toscano wrote: > On Thursday, 19 October 2017 15:14:24 CEST Pino Toscano wrote: > > GLib has shipped a testing framework for many years already, so we can > > make use of it, replacing the external "check". > > > > The conversion only switches framework without changing the structure of > > the tests, making use of the more appropriate assertion in the various > > places. > > > > Signed-off-by: Pino Toscano > > --- > > Meh, I suck, I accentally pushed it (see why I did not wanted powers!). > Apologies. > > I can revert it right now, if needed. Otherwise, if there are just > small edges to smooth, I can post cleanup patches. Let me know. Its not a problem - it all looks fine to me - I just had one RFE suggestion 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 :| From ptoscano at redhat.com Thu Oct 19 13:59:02 2017 From: ptoscano at redhat.com (Pino Toscano) Date: Thu, 19 Oct 2017 15:59:02 +0200 Subject: [Libosinfo] [libosinfo PATCH] tests: convert from check to the GLib testing framework In-Reply-To: <20171019133628.GP8408@redhat.com> References: <20171019131424.21880-1-ptoscano@redhat.com> <20171019133628.GP8408@redhat.com> Message-ID: <1618919.XH1XzvU8nI@thyrus.usersys.redhat.com> On Thursday, 19 October 2017 15:36:28 CEST Daniel P. Berrange wrote: > On Thu, Oct 19, 2017 at 03:14:24PM +0200, Pino Toscano wrote: > > diff --git a/tests/test-isodetect.c b/tests/test-isodetect.c > > index 7214531..97c86c4 100644 > > --- a/tests/test-isodetect.c > > +++ b/tests/test-isodetect.c > > > -int main(void) > > -{ > > - int number_failed; > > - Suite *s = list_suite(); > > - SRunner *sr = srunner_create(s); > > + g_test_init(&argc, &argv, NULL); > > + > > + g_test_add_func("/isodetect/fedora", test_fedora); > > + g_test_add_func("/isodetect/rhel", test_rhel); > > + g_test_add_func("/isodetect/ubuntu", test_ubuntu); > > + g_test_add_func("/isodetect/debian", test_debian); > > + g_test_add_func("/isodetect/windows", test_windows); > > + g_test_add_func("/isodetect/freebsd", test_freebsd); > > + g_test_add_func("/isodetect/openbsd", test_openbsd); > > + g_test_add_func("/isodetect/opensuse", test_opensuse); > > + g_test_add_func("/isodetect/centos", test_centos); > > + g_test_add_func("/isodetect/gnome", test_gnome); > > + g_test_add_func("/isodetect/altlinux", test_altlinux); > > + g_test_add_func("/isodetect/mageia", test_mageia); > > + g_test_add_func("/isodetect/sles", test_sles); > > + g_test_add_func("/isodetect/sled", test_sled); > > We could wrap all of this in a > > if (g_test_slow()) { > .... > } > > so that this only executes if people request slow tests via '-m slow' arg Hm aren't these tests worth executing by default? Not sure what is the proper definition of "slow" for GLib tests though, and test-isodetect takes less than 20 seconds to run here. -- Pino Toscano -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part. URL: From berrange at redhat.com Thu Oct 19 14:02:18 2017 From: berrange at redhat.com (Daniel P. Berrange) Date: Thu, 19 Oct 2017 15:02:18 +0100 Subject: [Libosinfo] [libosinfo PATCH] tests: convert from check to the GLib testing framework In-Reply-To: <1618919.XH1XzvU8nI@thyrus.usersys.redhat.com> References: <20171019131424.21880-1-ptoscano@redhat.com> <20171019133628.GP8408@redhat.com> <1618919.XH1XzvU8nI@thyrus.usersys.redhat.com> Message-ID: <20171019140218.GR8408@redhat.com> On Thu, Oct 19, 2017 at 03:59:02PM +0200, Pino Toscano wrote: > On Thursday, 19 October 2017 15:36:28 CEST Daniel P. Berrange wrote: > > On Thu, Oct 19, 2017 at 03:14:24PM +0200, Pino Toscano wrote: > > > diff --git a/tests/test-isodetect.c b/tests/test-isodetect.c > > > index 7214531..97c86c4 100644 > > > --- a/tests/test-isodetect.c > > > +++ b/tests/test-isodetect.c > > > > > -int main(void) > > > -{ > > > - int number_failed; > > > - Suite *s = list_suite(); > > > - SRunner *sr = srunner_create(s); > > > + g_test_init(&argc, &argv, NULL); > > > + > > > + g_test_add_func("/isodetect/fedora", test_fedora); > > > + g_test_add_func("/isodetect/rhel", test_rhel); > > > + g_test_add_func("/isodetect/ubuntu", test_ubuntu); > > > + g_test_add_func("/isodetect/debian", test_debian); > > > + g_test_add_func("/isodetect/windows", test_windows); > > > + g_test_add_func("/isodetect/freebsd", test_freebsd); > > > + g_test_add_func("/isodetect/openbsd", test_openbsd); > > > + g_test_add_func("/isodetect/opensuse", test_opensuse); > > > + g_test_add_func("/isodetect/centos", test_centos); > > > + g_test_add_func("/isodetect/gnome", test_gnome); > > > + g_test_add_func("/isodetect/altlinux", test_altlinux); > > > + g_test_add_func("/isodetect/mageia", test_mageia); > > > + g_test_add_func("/isodetect/sles", test_sles); > > > + g_test_add_func("/isodetect/sled", test_sled); > > > > We could wrap all of this in a > > > > if (g_test_slow()) { > > .... > > } > > > > so that this only executes if people request slow tests via '-m slow' arg > > Hm aren't these tests worth executing by default? Not sure what is the > proper definition of "slow" for GLib tests though, and test-isodetect > takes less than 20 seconds to run here. They're primarily useful for upstream to run - I don't think there's much benefit downstream users running them. So I think its the kind of thing where we could put '-m slow' into our CI system tests. THis would avoid downstream users needing networking during tests too IIUC. 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 :| From ptoscano at redhat.com Thu Oct 19 14:14:14 2017 From: ptoscano at redhat.com (Pino Toscano) Date: Thu, 19 Oct 2017 16:14:14 +0200 Subject: [Libosinfo] [libosinfo PATCH] tests: convert from check to the GLib testing framework In-Reply-To: <20171019140218.GR8408@redhat.com> References: <20171019131424.21880-1-ptoscano@redhat.com> <1618919.XH1XzvU8nI@thyrus.usersys.redhat.com> <20171019140218.GR8408@redhat.com> Message-ID: <3995609.scyvucvMyy@thyrus.usersys.redhat.com> On Thursday, 19 October 2017 16:02:18 CEST Daniel P. Berrange wrote: > On Thu, Oct 19, 2017 at 03:59:02PM +0200, Pino Toscano wrote: > > On Thursday, 19 October 2017 15:36:28 CEST Daniel P. Berrange wrote: > > > On Thu, Oct 19, 2017 at 03:14:24PM +0200, Pino Toscano wrote: > > > > diff --git a/tests/test-isodetect.c b/tests/test-isodetect.c > > > > index 7214531..97c86c4 100644 > > > > --- a/tests/test-isodetect.c > > > > +++ b/tests/test-isodetect.c > > > > > > > -int main(void) > > > > -{ > > > > - int number_failed; > > > > - Suite *s = list_suite(); > > > > - SRunner *sr = srunner_create(s); > > > > + g_test_init(&argc, &argv, NULL); > > > > + > > > > + g_test_add_func("/isodetect/fedora", test_fedora); > > > > + g_test_add_func("/isodetect/rhel", test_rhel); > > > > + g_test_add_func("/isodetect/ubuntu", test_ubuntu); > > > > + g_test_add_func("/isodetect/debian", test_debian); > > > > + g_test_add_func("/isodetect/windows", test_windows); > > > > + g_test_add_func("/isodetect/freebsd", test_freebsd); > > > > + g_test_add_func("/isodetect/openbsd", test_openbsd); > > > > + g_test_add_func("/isodetect/opensuse", test_opensuse); > > > > + g_test_add_func("/isodetect/centos", test_centos); > > > > + g_test_add_func("/isodetect/gnome", test_gnome); > > > > + g_test_add_func("/isodetect/altlinux", test_altlinux); > > > > + g_test_add_func("/isodetect/mageia", test_mageia); > > > > + g_test_add_func("/isodetect/sles", test_sles); > > > > + g_test_add_func("/isodetect/sled", test_sled); > > > > > > We could wrap all of this in a > > > > > > if (g_test_slow()) { > > > .... > > > } > > > > > > so that this only executes if people request slow tests via '-m slow' arg > > > > Hm aren't these tests worth executing by default? Not sure what is the > > proper definition of "slow" for GLib tests though, and test-isodetect > > takes less than 20 seconds to run here. > > They're primarily useful for upstream to run - I don't think there's much > benefit downstream users running them. So I think its the kind of thing > where we could put '-m slow' into our CI system tests. Couldn't it be useful for downstream as well, i.e. to check that the data provided in osinfo-db actually match the expected ISO data? Say in case a downstream adds custom changes (or backport upstream commits), so they know the modified osinfo-db is OK. > THis would avoid downstream users needing networking during tests too IIUC. Note that test-isodetect does not require networking, as it uses the data in tests/isodata. -- Pino Toscano -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part. URL: From agx at sigxcpu.org Fri Oct 20 07:16:21 2017 From: agx at sigxcpu.org (Guido =?iso-8859-1?Q?G=FCnther?=) Date: Fri, 20 Oct 2017 09:16:21 +0200 Subject: [Libosinfo] [libosinfo PATCH] tests: convert from check to the GLib testing framework In-Reply-To: <3995609.scyvucvMyy@thyrus.usersys.redhat.com> References: <20171019131424.21880-1-ptoscano@redhat.com> <1618919.XH1XzvU8nI@thyrus.usersys.redhat.com> <20171019140218.GR8408@redhat.com> <3995609.scyvucvMyy@thyrus.usersys.redhat.com> Message-ID: <20171020071621.4up7k5vahimd5q4d@bogon.m.sigxcpu.org> Hi, On Thu, Oct 19, 2017 at 04:14:14PM +0200, Pino Toscano wrote: > On Thursday, 19 October 2017 16:02:18 CEST Daniel P. Berrange wrote: > > On Thu, Oct 19, 2017 at 03:59:02PM +0200, Pino Toscano wrote: > > > On Thursday, 19 October 2017 15:36:28 CEST Daniel P. Berrange wrote: > > > > On Thu, Oct 19, 2017 at 03:14:24PM +0200, Pino Toscano wrote: > > > > > diff --git a/tests/test-isodetect.c b/tests/test-isodetect.c > > > > > index 7214531..97c86c4 100644 > > > > > --- a/tests/test-isodetect.c > > > > > +++ b/tests/test-isodetect.c > > > > > > > > > -int main(void) > > > > > -{ > > > > > - int number_failed; > > > > > - Suite *s = list_suite(); > > > > > - SRunner *sr = srunner_create(s); > > > > > + g_test_init(&argc, &argv, NULL); > > > > > + > > > > > + g_test_add_func("/isodetect/fedora", test_fedora); > > > > > + g_test_add_func("/isodetect/rhel", test_rhel); > > > > > + g_test_add_func("/isodetect/ubuntu", test_ubuntu); > > > > > + g_test_add_func("/isodetect/debian", test_debian); > > > > > + g_test_add_func("/isodetect/windows", test_windows); > > > > > + g_test_add_func("/isodetect/freebsd", test_freebsd); > > > > > + g_test_add_func("/isodetect/openbsd", test_openbsd); > > > > > + g_test_add_func("/isodetect/opensuse", test_opensuse); > > > > > + g_test_add_func("/isodetect/centos", test_centos); > > > > > + g_test_add_func("/isodetect/gnome", test_gnome); > > > > > + g_test_add_func("/isodetect/altlinux", test_altlinux); > > > > > + g_test_add_func("/isodetect/mageia", test_mageia); > > > > > + g_test_add_func("/isodetect/sles", test_sles); > > > > > + g_test_add_func("/isodetect/sled", test_sled); > > > > > > > > We could wrap all of this in a > > > > > > > > if (g_test_slow()) { > > > > .... > > > > } > > > > > > > > so that this only executes if people request slow tests via '-m slow' arg > > > > > > Hm aren't these tests worth executing by default? Not sure what is the > > > proper definition of "slow" for GLib tests though, and test-isodetect > > > takes less than 20 seconds to run here. > > > > They're primarily useful for upstream to run - I don't think there's much > > benefit downstream users running them. So I think its the kind of thing > > where we could put '-m slow' into our CI system tests. > > Couldn't it be useful for downstream as well, i.e. to check that the > data provided in osinfo-db actually match the expected ISO data? Say > in case a downstream adds custom changes (or backport upstream commits), > so they know the modified osinfo-db is OK. > > > THis would avoid downstream users needing networking during tests too IIUC. > > Note that test-isodetect does not require networking, as it uses the > data in tests/isodata. >From a distro point of view I'd rather have these run by default and see -mslow preserved for really slow tests. Cheers, -- Guido From cfergeau at redhat.com Fri Oct 20 08:36:35 2017 From: cfergeau at redhat.com (Christophe Fergeau) Date: Fri, 20 Oct 2017 10:36:35 +0200 Subject: [Libosinfo] [PATCH osinfo-db] freebsd: add FreeBSD 10.4 info In-Reply-To: <20171019043103.GB20932@dev.san.ru> References: <20171005103841.26129-1-bogorodskiy@gmail.com> <20171016091042.GL29716@natto.ory.fergeau.eu> <20171017084140.GA2649@kloomba> <20171017150831.GH29716@natto.ory.fergeau.eu> <20171018060534.GA20932@dev.san.ru> <20171018072115.GO29716@natto.ory.fergeau.eu> <20171019043103.GB20932@dev.san.ru> Message-ID: <20171020083635.GV32205@natto.ory.fergeau.eu> Hey, I just pushed your 2 patches unchanged given that use of derives-from is fairly wide-spread and not limited to your patch. Christophe On Thu, Oct 19, 2017 at 08:31:05AM +0400, Roman Bogorodskiy wrote: > Christophe Fergeau wrote: > > > On Wed, Oct 18, 2017 at 10:05:36AM +0400, Roman Bogorodskiy wrote: > > > This sounds reasonable to me. Should we also drop 'derives-from' from > > > the previous releases' entries? > > > > Hmm, git grep'ping, derives-from is used all over the place ;) One thing > > I don't know for sure is whether it should be used for major upgrades > > (RHEL 6 to RHEL 7, or Fedora 21 to 22). > > > > > Also, thinking about it, I'm not sure about one thing regarding > > > 'upgrades': FreeBSD supports multiple major versions in parallel. > > > > > > For example it could be this way: > > > > > > 10.3 -> 10.4 > > > | > > > 11.0 -> 11.1 -> ... -> 11.X > > > > > > So 10.4 will become a dead end because there'll be no entries that > > > refer it in (e.g. 11.X will refer 11.(X-1)). What's the right > > > way to handle that? > > > > I don't know how much it is documented that 11.0 upgrades 10.3 and not > > 10.4? Is it just this way because we added to the database first 10.3, > > then 11.0, and finally 10.4? Or are there stronger requirements? > > Yeah, it's this way because 11.0 goes before 10.4. > > > Most of the times, things are this way in the database because of the > > timing of additions, if 11.0 was added later than 10.4, 11.0 would be > > marked as upgrading 10.4 rather than 10.3. > > So it might make sense to update the 11.0 entry to refer to 10.4 if > > needed. However, I don't think a lot of things are looking into these > > upgrades/derives links. Maybe libosinfo follows them for device support( > > I always forget ;) And it probably does not matter too much to have dead > > ends. > > Ok, so let it be as it is now. > > Roman Bogorodskiy > _______________________________________________ > Libosinfo mailing list > Libosinfo at redhat.com > https://www.redhat.com/mailman/listinfo/libosinfo -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From berrange at redhat.com Fri Oct 20 08:53:37 2017 From: berrange at redhat.com (Daniel P. Berrange) Date: Fri, 20 Oct 2017 09:53:37 +0100 Subject: [Libosinfo] [PATCH osinfo-db] freebsd: add FreeBSD 10.4 info In-Reply-To: <20171018060534.GA20932@dev.san.ru> References: <20171005103841.26129-1-bogorodskiy@gmail.com> <20171016091042.GL29716@natto.ory.fergeau.eu> <20171017084140.GA2649@kloomba> <20171017150831.GH29716@natto.ory.fergeau.eu> <20171018060534.GA20932@dev.san.ru> Message-ID: <20171020085337.GA21172@redhat.com> On Wed, Oct 18, 2017 at 10:05:36AM +0400, Roman Bogorodskiy wrote: > Christophe Fergeau wrote: > > > Hey, > > > > On Tue, Oct 17, 2017 at 01:00:38PM +0400, Roman Bogorodskiy wrote: > > > Christophe Fergeau wrote: > > > > > > > On Thu, Oct 05, 2017 at 02:38:41PM +0400, Roman Bogorodskiy wrote: > > > > > --- > > > > > data/os/freebsd.org/freebsd-10.4.xml.in | 51 +++++++++++++++++++++++++++++++++ > > > > > 1 file changed, 51 insertions(+) > > > > > create mode 100644 data/os/freebsd.org/freebsd-10.4.xml.in > > > > > > > > > > diff --git a/data/os/freebsd.org/freebsd-10.4.xml.in b/data/os/freebsd.org/freebsd-10.4.xml.in > > > > > new file mode 100644 > > > > > index 0000000..5697b69 > > > > > --- /dev/null > > > > > +++ b/data/os/freebsd.org/freebsd-10.4.xml.in > > > > > @@ -0,0 +1,51 @@ > > > > > + > > > > > + > > > > > + > > > > > + freebsd10.4 > > > > > + <_name>FreeBSD 10.4 > > > > > + 10.4 > > > > > + <_vendor>FreeBSD Project > > > > > + freebsd > > > > > + freebsd > > > > > + > > > > > + > > > > > > > > There was some conversation on IRC regarding upgrades VS derives-from, I > > > > don't think derives-from is needed here. > > > > > > Could you please clarify when it's appropriate to use derives-from? > > > > > > PS It looks like these are not pushed yet. Do you want me to send v2 > > > with derives-from dropped or you can amend that before pushing? > > > > Yeah, did not push them on purpose waiting for your feedback :) I can > > amend before pushing, sure. My understanding of derives-from is that > > it's for special cases like ubuntu being forked off debian, or rhel > > deriving from fedora, or centos from RHEL. It's not meant to describe > > regular upgrades from one version to the next. > > > > Christophe > > This sounds reasonable to me. Should we also drop 'derives-from' from > the previous releases' entries? > > Also, thinking about it, I'm not sure about one thing regarding > 'upgrades': FreeBSD supports multiple major versions in parallel. > > For example it could be this way: > > 10.3 -> 10.4 > | > 11.0 -> 11.1 -> ... -> 11.X > > So 10.4 will become a dead end because there'll be no entries that > refer it in (e.g. 11.X will refer 11.(X-1)). What's the right > way to handle that? Usually we just end up having 'upgrades' in release-date order, and then fixing up minor updates after the fact. eg when 10.4 comes out, switch 11.0 to be upgrades from 10.4 instead of 10.3 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 :| From ptoscano at redhat.com Fri Oct 20 15:58:17 2017 From: ptoscano at redhat.com (Pino Toscano) Date: Fri, 20 Oct 2017 17:58:17 +0200 Subject: [Libosinfo] [osinfo-db PATCH] ubuntu: add Ubuntu 17.10 info Message-ID: <20171020155817.12793-1-ptoscano@redhat.com> Sources: - https://insights.ubuntu.com/2017/10/19/ubuntu-17-10-releases-with-gnome-kubernetes-1-8-minimal-base-images/ Signed-off-by: Pino Toscano --- data/os/ubuntu.com/ubuntu-17.10.xml.in | 79 ++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 data/os/ubuntu.com/ubuntu-17.10.xml.in diff --git a/data/os/ubuntu.com/ubuntu-17.10.xml.in b/data/os/ubuntu.com/ubuntu-17.10.xml.in new file mode 100644 index 0000000..4b75eed --- /dev/null +++ b/data/os/ubuntu.com/ubuntu-17.10.xml.in @@ -0,0 +1,79 @@ + + + + ubuntu17.10 + ubuntuartful + <_name>Ubuntu 17.10 + 17.10 + <_vendor>Canonical Ltd + linux + ubuntu + Artful Aardvark + + + + 2017-10-19 + + + + 1000000000 + 1 + 1073741824 + 5368709120 + + + 1000000000 + 1073741824 + 16106127360 + + + + + http://releases.ubuntu.com/releases/artful/ubuntu-17.10-server-i386.iso + + Ubuntu-Server 17.10(.\d)? i386 + + install/vmlinuz + install/initrd.gz + + + http://releases.ubuntu.com/releases/artful/ubuntu-17.10-server-amd64.iso + + Ubuntu-Server 17.10(.\d)? amd64 + + install/vmlinuz + install/initrd.gz + + + http://releases.ubuntu.com/releases/artful/ubuntu-17.10-desktop-amd64.iso + + Ubuntu 17.10(.\d)? amd64 + + casper/vmlinuz + casper/initrd.lz + + + http://cdimage.ubuntu.com/releases/artful/release/ubuntu-17.10-server-arm64.iso + + Ubuntu-Server 17.10(.\d)? arm64 + + + + http://cdimage.ubuntu.com/releases/artful/release/ubuntu-17.10-server-ppc64el.iso + + Ubuntu-Server 17.10(.\d)? ppc64 + + + + http://cdimage.ubuntu.com/releases/artful/release/ubuntu-17.10-server-s390x.iso + + Ubuntu-Server 17.10(.\d)? s390x + + + + +