From 02ae89bba1548512ef4ff4f427969cc26a43f346 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Jun 28 2017 09:11:51 +0000 Subject: [PATCH 1/3] Make selfcheck.py be more flexible by taking command line arguments This patch lets the user tell selfcheck.py which fedabipkgdiff and abipkgdiff program to use, without having to 'make install' Libabigail. This is extremely useful when willing to test several branches of Libabigail using selfcheck.py, in parallel. Also, it makes selfcheck.py be more flexible as it doesn't emit its output to a predefined file and doesn't expect a predefined file as its input either. The patch updates the README.md file accordingly, adds a new package_list.fedora25-critpath.json file that defines critpath packages for Fedora 25 and removes the package_list.json which is fairly useless in practise. With time, I think we'll be adding new critpath packages set for other Fedora distributions. * README.md: Update this file for more precise wording, mention the new package_list.fedora25-critpath.json, remove mention to the package_list.json and selfcheck.log files. * package_list.fedora25-critpath.json: Add new file. * package_list.json: Remove this file. * selfcheck.py (build_commandline_args_parser, main): Define new functions. The main function contains the logic that was initially coded globally in the script. Signed-off-by: Dodji Seketeli --- diff --git a/README.md b/README.md index dc223ca..cf29c35 100644 --- a/README.md +++ b/README.md @@ -2,26 +2,33 @@ Introduction: ============== -libabigail-selfcheck project is aimed to perform checks on libabigail. -It will help in detecting bugs which might get introduced with new commits -in libabigail. +The libabigail-selfcheck project performs regression tests for the +Libabigail project. It does so by using Libabigail to compare the ABI +of Fedora packages against themselves. The result of such comparisons +should be the empty set. -It makes use of libabigail's fedabipkgdiff tool with option --self-compare. + +This project thus uses the fedabipkgdiff tool, especially with its +--self-compare option. Files and their meanings: ========================== * selfcheck.py - Python script containing main logic -* package_list.json - List of packages in json format. This list is inspired - from critpath pacakge list in Fedora. One can find updated and complete - list of cripath packages in Fedora for supported releases at - https://admin.fedoraproject.org/pkgdb/api/critpath?format=json -* selfcheck.log - Dynamic file created after running selfcheck.py script - containing detailed logs of selfcheck run. + +* package_list.fedora25-critpath.json - The set of critpath packages +of the Fedora 25 distribution. It has been edited from the generic +critpath packages description that can be retrieved from +https://admin.fedoraproject.org/pkgdb/api/critpath?format=json Running selfcheck: ================== To execute it, run: -$ python selfcheck.py -e.g python selfcheck.py ~/libabigail/tools/ +$ selfcheck.py --fedabipkgdiff \ + --abipkgdiff \ + package-set-json-file > output-file.txt + +Or, if the fedabipkgdiff and abipkgdiff programs can be found in the +default $PATH environment variable, then just run: +$ selfcheck.py package-set-json-file > output-file.txt diff --git a/package_list.fedora25-critpath.json b/package_list.fedora25-critpath.json new file mode 100644 index 0000000..21500ec --- /dev/null +++ b/package_list.fedora25-critpath.json @@ -0,0 +1,783 @@ +{ + "pkgs": { + "f25": [ + "xorg-x11-server-utils", + "giflib", + "basesystem", + "repoview", + "parted", + "libxslt", + "elfutils", + "libgpg-error", + "libXxf86dga", + "libselinux", + "koji", + "deltarpm", + "libxcb", + "expat", + "xorg-x11-drv-fbdev", + "cdparanoia", + "setup", + "pungi", + "libxkbfile", + "ppc64-utils", + "xorg-x11-drv-ati", + "libSM", + "policycoreutils", + "libXxf86misc", + "nspr", + "python-lxml", + "pyparted", + "libedit", + "openssh", + "atk", + "hfsplus-tools", + "libatomic_ops", + "pkgconfig", + "NetworkManager", + "guile", + "gnupg", + "libcroco", + "telepathy-glib", + "rpm", + "pytz", + "libwnck", + "kdelibs", + "syslinux", + "findutils", + "libraw1394", + "createrepo", + "patch", + "enchant", + "libsmbios", + "libXres", + "mdadm", + "hwdata", + "libXtst", + "gnome-terminal", + "libXrandr", + "newt", + "xkeyboard-config", + "redhat-rpm-config", + "libXcursor", + "bridge-utils", + "libXpm", + "avahi", + "libassuan", + "clutter-gtk", + "perl-Error", + "make", + "libsoup", + "fuse", + "libdrm", + "libsepol", + "gzip", + "keyutils", + "librtas", + "libdmx", + "vim", + "ntfs-3g", + "xorg-x11-xauth", + "libXrender", + "perl-TermReadKey", + "libfontenc", + "libgsf", + "libgtop2", + "tracker", + "icu", + "fedora-release", + "evolution-data-server", + "libxfce4util", + "sgml-common", + "ppp", + "git", + "kde-filesystem", + "python-pycurl", + "libxklavier", + "libtheora", + "attr", + "libXvMC", + "libXmu", + "libogg", + "libICE", + "diffutils", + "mpfr", + "iputils", + "gpgme", + "libibverbs", + "python-setuptools", + "libtirpc", + "xorg-x11-server", + "anaconda", + "bc", + "boost", + "gawk", + "nmap", + "perl", + "dbus-python", + "libnotify", + "kexec-tools", + "util-linux", + "pixman", + "cdrkit", + "brltty", + "psmisc", + "OpenEXR", + "cairo", + "poppler", + "yum-utils", + "tcp_wrappers", + "libXcomposite", + "mtools", + "mesa", + "comps-extras", + "authconfig", + "libevent", + "docbook-dtds", + "xorg-x11-xkb-utils", + "hicolor-icon-theme", + "control-center", + "perl-Pod-Simple", + "dbus-glib", + "crontabs", + "libcap", + "redhat-menus", + "gnome-session", + "iproute", + "lua", + "ethtool", + "cpio", + "desktop-backgrounds", + "enca", + "libpciaccess", + "telepathy-filesystem", + "gnupg2", + "cracklib", + "which", + "gnome-keyring", + "libdaemon", + "zenity", + "chkconfig", + "texinfo", + "iscsi-initiator-utils", + "openldap", + "sed", + "gamin", + "gdb", + "gdm", + "samba", + "lzop", + "pyOpenSSL", + "dnsmasq", + "qemu", + "libXinerama", + "acl", + "jasper", + "libXxf86vm", + "emacs", + "notification-daemon", + "libshout", + "libsemanage", + "file", + "gettext", + "libutempter", + "kde-settings", + "e2fsprogs", + "mash", + "libksba", + "gdbm", + "libsndfile", + "gnutls", + "dosfstools", + "openbox", + "squashfs-tools", + "wpa_supplicant", + "libnetfilter_conntrack", + "qca", + "bash", + "flac", + "krb5", + "nautilus", + "alsa-lib", + "pykickstart", + "libgnomekbd", + "gnome-bluetooth", + "selinux-policy", + "lvm2", + "libidn", + "pam", + "cups", + "dmraid", + "libunwind", + "grep", + "dtc", + "iso-codes", + "passwd", + "quota", + "libdv", + "desktop-file-utils", + "libXdamage", + "usermode", + "exo", + "speex", + "libusb", + "sudo", + "less", + "fontconfig", + "libtar", + "libX11", + "libaio", + "libpng", + "cyrus-sasl", + "libgcrypt", + "lsof", + "binutils", + "xfsprogs", + "libXScrnSaver", + "ncurses", + "nfs-utils", + "imlib2", + "coreutils", + "python-krbV", + "gsm", + "librsvg2", + "libpcap", + "vino", + "xmlrpc-c", + "wireless-tools", + "GConf2", + "glibc", + "proj", + "openssl", + "libexif", + "glib2", + "libmng", + "nss", + "pcre", + "numactl", + "libiptcdata", + "libXt", + "libXv", + "libnfnetlink", + "libiec61883", + "libcdio", + "highlight", + "python-kid", + "curl", + "scrub", + "pyxattr", + "libtool", + "ustr", + "python-dateutil", + "gc", + "unzip", + "gtk2", + "livecd-tools", + "hunspell-en", + "device-mapper-multipath", + "sqlite", + "startup-notification", + "sysfsutils", + "libtasn1", + "xorg-x11-drv-vesa", + "gcc", + "system-config-keyboard", + "ebtables", + "zlib", + "zip", + "lxpanel", + "xfce4-session", + "kbd", + "xen", + "python", + "libXi", + "pango", + "dbus", + "rootfiles", + "dhcp", + "yum-metadata-parser", + "yum", + "libthai", + "wavpack", + "net-snmp", + "qt", + "perl-Pod-Escapes", + "python-urlgrabber", + "libuser", + "docbook-style-xsl", + "freetype", + "evolution", + "python-iniparse", + "libvorbis", + "rpcbind", + "iptables", + "fedora-logos", + "xdg-utils", + "rsync", + "libXft", + "tar", + "radvd", + "xorg-x11-xinit", + "pyxdg", + "cvs", + "gnome-menus", + "hexedit", + "kernel", + "libxml2", + "gmime", + "libvirt", + "audit", + "filesystem", + "lzo", + "libXfixes", + "exempi", + "gmp", + "libXdmcp", + "libvisual", + "xorg-x11-drv-evdev", + "shared-mime-info", + "libsigsegv", + "shadow-utils", + "libXau", + "xorg-x11-utils", + "clutter", + "dmidecode", + "epiphany", + "libavc1394", + "libtiff", + "readline", + "slang", + "groff", + "xdg-user-dirs", + "taglib", + "libXext", + "mcpp", + "initscripts", + "hunspell", + "pulseaudio", + "sg3_utils", + "lsscsi", + "bzip2", + "yelp", + "popt", + "blktrace", + "cheese", + "ilmbase", + "PackageKit", + "dash", + "hyphen", + "libssh2", + "powerpc-utils", + "libconfig", + "totem-pl-parser", + "isomd5sum", + "glusterfs", + "gvfs", + "python-kerberos", + "kde-l10n", + "libgweather", + "gnome-settings-daemon", + "python-pyasn1", + "libical", + "llvm", + "libvpd", + "cronie", + "libgee", + "libffi", + "color-filesystem", + "pcmanfm", + "nettle", + "librdmacm", + "xorg-x11-drv-nouveau", + "libarchive", + "python-ply", + "lsvpd", + "python-decorator", + "lua-socket", + "mozilla-filesystem", + "augeas", + "unique", + "python-beaker", + "python-mako", + "ca-certificates", + "plymouth", + "json-glib", + "libcgroup", + "lua-expat", + "libcanberra", + "lua-lpeg", + "sound-theme-freedesktop", + "phonon", + "perl-parent", + "btrfs-progs", + "python-slip", + "iw", + "libasyncns", + "libatasmart", + "python-chardet", + "libproxy", + "ibus", + "gssdp", + "gupnp", + "grub2", + "gupnp-av", + "bluez", + "corosync", + "lxde-common", + "openwsman", + "libev", + "gobject-introspection", + "chrony", + "xcb-util", + "fontpackages", + "xfce4-settings", + "xfconf", + "cups-pk-helper", + "crda", + "fipscheck", + "xorg-x11-drv-intel", + "menu-cache", + "tigervnc", + "openbios", + "libservicelog", + "sssd", + "lxmenu-data", + "s390utils", + "libhbaapi", + "libgdata", + "libhbalinux", + "fcoe-utils", + "netcf", + "sgpio", + "polkit-qt", + "libguestfs", + "libmetalink", + "libtalloc", + "libtdb", + "libplist", + "python-coverage", + "zerofree", + "lxsession", + "polkit", + "grubby", + "mobile-broadband-provider-info", + "rygel", + "kobo", + "libcap-ng", + "rtkit", + "rest", + "dracut", + "ModemManager", + "xz", + "volume_key", + "mutter", + "python-lockfile", + "python-meh", + "poppler-data", + "gjs", + "gnome-shell", + "nss-util", + "nss-softokn", + "libtevent", + "lua-json", + "pigz", + "dumpet", + "python-pip", + "libmpc", + "libunistring", + "libcue", + "hostname", + "attica", + "yajl", + "at-spi2-core", + "libgnome-keyring", + "at-spi2-atk", + "linux-firmware", + "pyatspi", + "seabios", + "libxfce4ui", + "garcon", + "jansson", + "python3", + "xorg-x11-drv-qxl", + "accountsservice", + "libimobiledevice", + "libbsd", + "caribou", + "hivex", + "lldpad", + "libldb", + "upower", + "gdisk", + "userspace-rcu", + "libfm", + "json-c", + "orc", + "man-db", + "libdb", + "ceph", + "dbusmenu-qt", + "dconf", + "libvpx", + "gtk3", + "yelp-xsl", + "uboot-tools", + "systemd", + "lcms2", + "libmodman", + "gnome-desktop3", + "libjpeg-turbo", + "python-markupsafe", + "gdk-pixbuf2", + "pyliblzma", + "mtdev", + "telepathy-logger", + "celt051", + "spice", + "qrencode", + "qt-mobility", + "mesa-demos", + "python-kitchen", + "gsettings-desktop-schemas", + "gupnp-dlna", + "liboauth", + "perl-threads-shared", + "python3-cairo", + "ding-libs", + "perl-threads", + "vte3", + "glib-networking", + "libbluray", + "keybinder", + "libxkbcommon", + "gnome-themes-standard", + "wayland", + "libnfsidmap", + "libindicator", + "libcacard", + "lorax", + "phonon-backend-gstreamer", + "firewalld", + "colord", + "abattis-cantarell-fonts", + "libqb", + "python-repoze-lru", + "perl-Scalar-List-Utils", + "v4l-utils", + "perl-PathTools", + "snappy", + "libpipeline", + "grilo", + "os-prober", + "libidn2", + "qtwebkit", + "sheepdog", + "libreport", + "gnome-online-accounts", + "harfbuzz", + "cogl", + "qtsoap", + "usbredir", + "python-html5lib", + "herqq", + "python-six", + "python-requests", + "p11-kit", + "libcryptui", + "pygobject3", + "graphite2", + "libmnl", + "perl-Carp", + "libgusb", + "ipset", + "libpwquality", + "cryptsetup", + "opus", + "libquvi-scripts", + "clucene09", + "libquvi", + "libverto", + "libgxps", + "perl-Socket", + "perl-Pod-Perldoc", + "sgabios", + "device-mapper-persistent-data", + "gcr", + "libwacom", + "kmod", + "libosinfo", + "libteam", + "libnl3", + "libwebp", + "libsolv", + "gperftools", + "numad", + "procps-ng", + "network-manager-applet", + "xcb-util-keysyms", + "ipxe", + "libsecret", + "xcb-util-wm", + "xcb-util-image", + "perl-Data-Dumper", + "glade", + "jbigkit", + "perl-srpm-macros", + "xcb-util-renderutil", + "libusbx", + "python-jsonschema", + "createrepo_c", + "dwz", + "lttng-ust", + "python-pyudev", + "colord-gtk", + "libseccomp", + "realmd", + "hawkey", + "python-beautifulsoup4", + "dnf", + "gssproxy", + "SLOF", + "gstreamer1", + "gstreamer1-plugins-base", + "gstreamer1-plugins-good", + "libldm", + "webrtc-audio-processing", + "perl-podlators", + "python-cssselect", + "libcdio-paranoia", + "ostree", + "sbc", + "shim-signed", + "gtkspell3", + "mariadb", + "babeltrace", + "python-blivet", + "perl-Pod-Usage", + "supermin", + "gcab", + "perl-Encode", + "python-urllib3", + "initial-setup", + "librepo", + "libiscsi", + "npth", + "perl-Time-Local", + "perl-HTTP-Tiny", + "qt5-qtbase", + "perl-Text-ParseWords", + "satyr", + "perl-constant", + "perl-Exporter", + "perl-File-Path", + "perl-File-Temp", + "perl-Getopt-Long", + "mozjs17", + "soxr", + "libndp", + "langtable", + "polkit-pkla-compat", + "qt5-qtdeclarative", + "edk2", + "libdbusmenu", + "python-requests-kerberos", + "libappindicator", + "fros", + "python-ntplib", + "python-pycparser", + "python-cffi", + "sddm", + "SDL2", + "keybinder3", + "libcomps", + "libevdev", + "qt5-qtxmlpatterns", + "geocode-glib", + "geoclue2", + "gnome-software", + "bcache-tools", + "lz4", + "efivar", + "libxshmfence", + "libtimezonemap", + "dnf-plugins-core", + "mozjs24", + "storaged", + "libmediaart", + "libinput", + "libappstream-glib", + "python-enum34", + "libusbmuxd", + "libepoxy", + "openjpeg2", + "ocaml-srpm-macros", + "adwaita-icon-theme", + "vte291", + "crypto-policies", + "appstream-data", + "ghc-srpm-macros", + "libdatrie", + "fedora-repos", + "perl-Term-ANSIColor", + "xorg-x11-drv-libinput", + "libpsl", + "webkitgtk4", + "gnat-srpm-macros", + "mokutil", + "python-cryptography", + "libstemmer", + "anaconda-user-help", + "speexdsp", + "python-idna", + "isl", + "libblockdev", + "publicsuffix-list", + "drpm", + "clutter-gst3", + "kate4", + "bind99", + "python-productmd", + "pcre2", + "fwupd", + "perl-Text-Tabs+Wrap", + "python-wrapt", + "virglrenderer", + "python-requests-file", + "python-requests-ftp", + "python-ipaddress", + "ipcalc", + "iio-sensor-proxy", + "fwupdate", + "libgudev", + "perl-MIME-Base64", + "perl-Term-Cap", + "perl-Unicode-Normalize", + "libgrss", + "nghttp2", + "go-srpm-macros", + "libnfs", + "python-pid", + "xfce-polkit", + "libipt", + "python-ordered-set", + "libbytesize", + "breeze-icon-theme", + "python-rpm-macros", + "fpc-srpm-macros", + "python-pysocks", + "python-multilib", + "flatpak", + "nss-pem", + "libXfont2", + "bubblewrap", + "qt5", + "python-pygpgme", + "osinfo-db-tools", + "osinfo-db", + "gnome-autoar", + "f25-backgrounds", + "libglvnd", + "switcheroo-control" + ] + } +} diff --git a/package_list.json b/package_list.json deleted file mode 100644 index 7a725d1..0000000 --- a/package_list.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "pkgs": { - "f24": [ - "rpm", - "pytz", - "libwnck", - "syslinux" - ], - "f25": [ - "xorg-x11-server-utils", - "giflib", - "basesystem", - "repoview", - "parted" - ], - "f26": [ - "python-lxml", - "pyparted", - "libedit", - "openssh", - "atk" - ], - "master": [ - "repoview", - "parted", - "libxslt", - "elfutils" - ] - } -} diff --git a/selfcheck.py b/selfcheck.py old mode 100644 new mode 100755 index 23afd11..c4cbab8 --- a/selfcheck.py +++ b/selfcheck.py @@ -5,56 +5,84 @@ import os.path import sys import subprocess import shlex +import argparse -fedabipkgdiff_bin_path = None -if len(sys.argv) == 2: - if os.path.isfile(sys.argv[1] + "/fedabipkgdiff"): - fedabipkgdiff_bin_path = sys.argv[1] + "/fedabipkgdiff" - else: - print "Enter valid path" - exit(1) -else: - print "selfcheck takes only one argument"\ - "which is fedabipkgdiff file path" - exit(1) - -with open('package_list.json') as data_file: - data = json.load(data_file) - -# Fedora release mapping to build target -fed_release_target = { +def build_commandline_args_parser(): + """Define the parser of the command line options and return it""" + + parser = argparse.ArgumentParser(description='Run Fedabipkgdiff on a set of packages') + + parser.add_argument('-f', '--fedabipkgdiff', + required = False, + dest = 'fedabipkgdiff_prog', + default = 'fedabipkgdiff', + help = 'Define the fedabipkgdiff program to use') + + parser.add_argument('-a', '--abipkgdiff', + required = False, + dest = 'abipkgdiff_prog', + default = None, + help = 'Define the abipkgdiff program to use') + + parser.add_argument('packages_set_file', + help = 'A JSON file containing the set of packages to consider') + + return parser + +def main(): + parser = build_commandline_args_parser() + global program_arguments + program_arguments = parser.parse_args() + + # Fedora release mapping to build target + fed_release_target = { 'master': 'fc27', 'f26': 'fc26', 'f25': 'fc25', 'f24': 'fc24', 'f23': 'fc23', -} - -sys.stdout = open('selfcheck.log', 'w') -# status tells overall return type of this script. -# status = 0 no ABI change -# status = 1, Error or ABI change found -status = 0 - -for fed_rel in data['pkgs'].keys(): - for pkg in data['pkgs'][fed_rel]: - cmd = "python %s "\ - "--self-compare -a --from %s %s" % (fedabipkgdiff_bin_path, - fed_release_target[fed_rel], pkg) - print "Running '%s'" % cmd - args = shlex.split(cmd) - proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - # Get error and abipkgdiff execution output - stdout, stderr = proc.communicate() - if stderr: - status = max(status, 1) - print 'Error encountered while running fedabipkgdiff with '\ + } + + fedabipkgdiff = program_arguments.fedabipkgdiff_prog + if program_arguments.abipkgdiff_prog: + fedabipkgdiff += ' --abipkgdiff ' + program_arguments.abipkgdiff_prog + + # status tells overall return type of this script. + # status = 0 no ABI change + # status = 1, Error or ABI change found + status = 0 + + with open(program_arguments.packages_set_file) as data_file: + data = json.load(data_file) + + for fed_rel in data['pkgs'].keys(): + for pkg in data['pkgs'][fed_rel]: + cmd = "%s --self-compare -a --from %s %s" \ + % (fedabipkgdiff, + fed_release_target[fed_rel], + pkg) + + print "Running '%s'" % cmd + sys.stdout.flush() + args = shlex.split(cmd) + proc = subprocess.Popen(args, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + # Get error and abipkgdiff execution output + stdout, stderr = proc.communicate() + if stderr: + status = max(status, 1) + print 'Error encountered while running fedabipkgdiff with '\ 'error message: \n %s' % stderr - else: - if proc.returncode == 0: - status = max(status, 0) - else: - print stdout - status = max(status, 1) -exit (status) + sys.stdout.flush() + else: + if proc.returncode == 0: + status = max(status, 0) + else: + print stdout + status = max(status, 1) + return status + +if __name__ == '__main__': + sys.exit(main()) From 1ba4bec91c3ebf40bf789c94b4701d715ba9503f Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Jul 03 2017 15:50:57 +0000 Subject: [PATCH 2/3] Remove fedora-release and S390utils from the F25 critpath set I am removing the fedora-release package as it's obviously is not suitable or ABI verification, and the S390utils package as it's not present in Fedora 25's primary Koji. * package_list.fedora25-critpath.json: Remove s390utils and fedora-release packages. Signed-off-by: Dodji Seketeli --- diff --git a/package_list.fedora25-critpath.json b/package_list.fedora25-critpath.json index 21500ec..f0e970a 100644 --- a/package_list.fedora25-critpath.json +++ b/package_list.fedora25-critpath.json @@ -85,7 +85,6 @@ "libgtop2", "tracker", "icu", - "fedora-release", "evolution-data-server", "libxfce4util", "sgml-common", @@ -442,7 +441,6 @@ "libservicelog", "sssd", "lxmenu-data", - "s390utils", "libhbaapi", "libgdata", "libhbalinux", From c9ee2717011a4f905c8ac25238a52b3966e00ebb Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Jul 04 2017 14:51:59 +0000 Subject: [PATCH 3/3] Remove the kernel from the critpath set The Linux kernel package is not yet supported by abipkgdiff so removing it from the set of packages we are running on, for now. * package_list.fedora25-critpath.json: Remove the "kernel" package from the set. Signed-off-by: Dodji Seketeli --- diff --git a/package_list.fedora25-critpath.json b/package_list.fedora25-critpath.json index f0e970a..832fb34 100644 --- a/package_list.fedora25-critpath.json +++ b/package_list.fedora25-critpath.json @@ -321,7 +321,6 @@ "cvs", "gnome-menus", "hexedit", - "kernel", "libxml2", "gmime", "libvirt",