From 5f2f6e886e8973d10c6fb8421af9359607abc1d2 Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: Dec 20 2018 09:39:01 +0000 Subject: flatpak generator: move test files out of source Signed-off-by: Nils Philippsen --- diff --git a/tests/files/flatpak/apps.json b/tests/files/flatpak/apps.json new file mode 100644 index 0000000..bf8df16 --- /dev/null +++ b/tests/files/flatpak/apps.json @@ -0,0 +1,7 @@ +[{"flatpakAppId":"org.gnome.eog", + "name":"Eye of GNOME", + "summary":"Browse and rotate images", + "iconDesktopUrl":"/repo/appstream/x86_64/icons/128x128/org.gnome.eog.png"}, +{"flatpakAppId":"org.gnome.FeedReader", + "name":"FeedReader","summary":"RSS client for various webservices", + "iconDesktopUrl":"/repo/appstream/x86_64/icons/128x128/org.gnome.FeedReader.png"}] diff --git a/tests/files/flatpak/eog.json b/tests/files/flatpak/eog.json new file mode 100644 index 0000000..3627519 --- /dev/null +++ b/tests/files/flatpak/eog.json @@ -0,0 +1,16 @@ +{ + "app-id": "org.gnome.eog", + "runtime": "org.gnome.Platform", + "runtime-version": "3.30", + "sdk": "org.gnome.Sdk", + "branch": "stable", + "command": "eog", + "rename-desktop-file": "eog.desktop", + "rename-appdata-file": "eog.appdata.xml", + "rename-icon": "eog", + "copy-icon": true, + "finish-args": + /* X11 + XShm access */ + ["--share=ipc", + "--socket=x11"] +} diff --git a/tests/files/flatpak/eog.yaml b/tests/files/flatpak/eog.yaml new file mode 100644 index 0000000..1c26a29 --- /dev/null +++ b/tests/files/flatpak/eog.yaml @@ -0,0 +1,14 @@ +app-id: org.gnome.eog +runtime: org.gnome.Platform +runtime-version: '3.30' +sdk: org.gnome.Sdk +branch: stable +command: eog +rename-desktop-file: eog.desktop +rename-appdata-file: eog.appdata.xml +rename-icon: eog +copy-icon: true +finish-args: + # X11 + XShm access + - --share=ipc + - --socket=x11 diff --git a/tests/files/flatpak/flatpak-runtime.mmd.yaml b/tests/files/flatpak/flatpak-runtime.mmd.yaml new file mode 100644 index 0000000..4800775 --- /dev/null +++ b/tests/files/flatpak/flatpak-runtime.mmd.yaml @@ -0,0 +1,120 @@ + +document: modulemd +version: 2 +data: + summary: Flatpak Runtime + description: This module defines two runtimes for Flatpaks. + license: + module: + - MIT + dependencies: + - buildrequires: + platform: [f29] + requires: + platform: [f29] + profiles: + runtime: + rpms: [ + 'flatpak-runtime-config', + 'abattis-cantarell-fonts', 'acl', 'libacl', 'adwaita-cursor-theme', + 'adwaita-icon-theme', 'alsa-lib', 'libargon2', 'aspell', + 'at-spi2-atk', 'at-spi2-core', 'atk', 'attr', 'libattr', 'audit-libs', + 'avahi-glib', 'avahi-libs', 'basesystem', 'bash', 'bluez-libs', + 'brotli', 'bzip2', 'bzip2-libs', 'ca-certificates', 'cairo', + 'cairo-gobject', 'cdparanoia-libs', 'chkconfig', 'clutter', + 'clutter-gst3', 'clutter-gtk', 'cogl', 'colord-libs', + 'compat-openssl10', 'compat-readline6', 'coreutils', + 'coreutils-common', 'cpio', 'cracklib', 'crypto-policies', + 'cryptsetup-libs', 'cups-libs', 'curl', 'libcurl', 'cyrus-sasl-lib', + 'dbus', 'dbus-common', 'dbus-daemon', 'dbus-libs', 'dbus-tools', + 'dbus-x11', 'dbus-glib', 'dconf', 'dejavu-fonts-common', + 'dejavu-sans-fonts', 'dejavu-sans-mono-fonts', 'dejavu-serif-fonts', + 'desktop-file-utils', 'libcom_err', 'libss', 'elfutils', + 'elfutils-default-yama-scope', 'elfutils-libelf', 'elfutils-libs', + 'emacs-filesystem', 'enchant', 'eosrei-emojione-fonts', 'expat', + 'fedora-release', 'fedora-gpg-keys', 'fedora-repos', 'file', + 'file-libs', 'filesystem', 'findutils', 'flac-libs', 'fontconfig', + 'fontpackages-filesystem', 'freetype', 'fribidi', 'gawk', 'gc', + 'libgcab1', 'libatomic', 'libgcc', 'libgfortran', 'libgomp', + 'libquadmath', 'libstdc++', 'gcr', 'gdbm', 'gdbm-libs', 'gdk-pixbuf2', + 'gdk-pixbuf2-modules', 'geoclue2', 'geoclue2-libs', 'gjs', + 'glib-networking', 'glib2', 'glibc', 'glibc-all-langpacks', + 'glibc-common', 'glibc-minimal-langpack', 'libnsl', 'gmp', + 'adwaita-gtk2-theme', 'gnome-themes-extra', 'gnu-free-fonts-common', + 'gnu-free-mono-fonts', 'gnu-free-sans-fonts', 'gnu-free-serif-fonts', + 'gnupg', 'gnupg2', 'gnupg2-smime', 'gnutls', 'gobject-introspection', + 'google-crosextra-caladea-fonts', 'google-crosextra-carlito-fonts', + 'google-noto-emoji-color-fonts', 'gpgme', 'graphite2', 'grep', + 'gsettings-desktop-schemas', 'gsm', 'gssdp', 'gstreamer1', + 'gstreamer1-plugins-bad-free', 'gstreamer1-plugins-base', 'gtk2', + 'gtk2-engines', 'gtk-update-icon-cache', 'gtk3', 'guile', 'gupnp', + 'gupnp-igd', 'gzip', 'harfbuzz', 'harfbuzz-icu', 'hicolor-icon-theme', + 'hunspell', 'hunspell-en-US', 'hwdata', 'hyphen', 'ibus-gtk2', + 'ibus-gtk3', 'ibus-libs', 'libicu', 'iptables-libs', 'iso-codes', + 'jasper-libs', 'jbigkit-libs', 'json-c', 'json-glib', 'qt-settings', + 'keyutils-libs', 'kmod-libs', 'krb5-libs', 'krb5-server', + 'krb5-workstation', 'libkadm5', 'lcms2', 'lcms2-utils', 'less', + 'libICE', 'libSM', 'libX11', 'libX11-common', 'libX11-xcb', + 'libXScrnSaver', 'libXau', 'libXcomposite', 'libXcursor', + 'libXdamage', 'libXdmcp', 'libXext', 'libXfixes', 'libXft', 'libXi', + 'libXinerama', 'libXpm', 'libXrandr', 'libXrender', 'libXt', + 'libXtst', 'libXv', 'libXxf86vm', 'libappstream-glib', 'libarchive', + 'libassuan', 'libasyncns', 'libatomic_ops', 'libcanberra', + 'libcanberra-gtk2', 'libcanberra-gtk3', 'libcap', 'libcap-ng', + 'libcroco', 'libdatrie', 'libdb', 'libdrm', 'libdvdnav', 'libdvdread', + 'libedit', 'libepoxy', 'liberation-fonts-common', + 'liberation-mono-fonts', 'liberation-sans-fonts', + 'liberation-serif-fonts', 'libev', 'libevdev', 'libexif', 'libffi', + 'libgcrypt', 'libglvnd', 'libglvnd-egl', 'libglvnd-gles', + 'libglvnd-glx', 'libglvnd-opengl', 'libgpg-error', 'libgudev', + 'libgusb', 'libidn2', 'libinput', 'libjpeg-turbo', 'turbojpeg', + 'libksba', 'libmetalink', 'libmng', 'libmodman', 'libmpc', + 'libmpcdec', 'libnice', 'libnotify', 'libnsl2', 'libogg', 'libpcap', + 'libpciaccess', 'libpng', 'libproxy', 'python2-libproxy', 'libpsl', + 'libpwquality', 'librsvg2', 'librsvg2-tools', 'libsamplerate', + 'libseccomp', 'libsecret', 'libselinux', 'libsemanage', 'libsepol', + 'libsigsegv', 'libsndfile', 'libsoup', 'libsrtp', 'libssh', + 'libstemmer', 'libtasn1', 'libtdb', 'libthai', 'libtheora', 'libtiff', + 'libtirpc', 'libtool-ltdl', 'libunistring', 'libusb', 'libusbx', + 'libutempter', 'libvdpau', 'libverto', 'libverto-libev', 'libvisual', + 'libvorbis', 'libwacom', 'libwacom-data', 'libwebp', 'libxcb', + 'libxcrypt', 'libxkbcommon', 'libxkbcommon-x11', 'libxml2', + 'python2-libxml2', 'libxshmfence', 'libxslt', 'llvm-libs', + 'logrotate', 'device-mapper', 'device-mapper-libs', 'lz4-libs', + 'ModemManager-glib', 'make', 'mesa-dri-drivers', 'mesa-filesystem', + 'mesa-libEGL', 'mesa-libGL', 'mesa-libgbm', 'mesa-libglapi', + 'mesa-libxatracker', 'mesa-vulkan-drivers', 'glx-utils', + 'mesa-libGLU', 'mlocate', 'mozjs60', 'mpfr', 'mpg123-libs', 'mtdev', + 'mythes', 'ncompress', 'ncurses', 'ncurses-base', + 'ncurses-compat-libs', 'ncurses-libs', 'nettle', 'libnghttp2', 'npth', + 'nspr', 'nss', 'nss-sysinit', 'nss-tools', 'nss-softokn', + 'nss-softokn-freebl', 'nss-util', 'ocl-icd', 'openal-soft', + 'openldap', 'openssl', 'openssl-libs', 'opus', 'orc', 'p11-kit', + 'p11-kit-trust', 'pam', 'pango', 'pcre', 'pcre-cpp', 'pcre2', + 'pcre2-utf16', 'pcre2-utf32', 'pinentry', 'pixman', 'libpkgconf', + 'pkgconf', 'pkgconf-m4', 'pkgconf-pkg-config', 'popt', 'procps-ng', + 'publicsuffix-list-dafsa', 'pulseaudio-libs', 'pulseaudio-libs-glib2', + 'pulseaudio-utils', 'python3-cairo', 'python3-gobject', + 'python3-gobject-base', 'python-pip-wheel', 'python-setuptools-wheel', + 'python2-setuptools', 'python-unversioned-command', 'python2', + 'python2-libs', 'python3', 'python3-libs', 'qrencode-libs', + 'readline', 'rest', 'rpcgen', 'SDL2', 'SDL2_image', 'SDL2_mixer', + 'SDL2_net', 'SDL2_ttf', 'sed', 'setup', 'xml-common', 'shadow-utils', + 'shared-mime-info', 'sound-theme-freedesktop', 'soundtouch', 'speex', + 'speexdsp', 'spirv-tools-libs', 'sqlite-libs', 'systemd', + 'systemd-libs', 'systemd-pam', 'tar', 'info', 'tzdata', 'unzip', + 'libblkid', 'libfdisk', 'libmount', 'libsmartcols', 'libuuid', + 'util-linux', 'vte-profile', 'vte291', 'vulkan-loader', + 'vulkan-validation-layers', 'libwayland-client', 'libwayland-cursor', + 'libwayland-egl', 'libwayland-server', 'webkit2gtk3', + 'webkit2gtk3-jsc', 'webrtc-audio-processing', 'which', 'woff2', + 'words', 'xcb-util', 'xcb-util-cursor', 'xcb-util-image', + 'xcb-util-keysyms', 'xcb-util-renderutil', 'xcb-util-wm', + 'xdg-user-dirs', 'xdg-utils', 'xkeyboard-config', 'xz', 'xz-libs', + 'xz-lzma-compat', 'yelp', 'yelp-libs', 'yelp-xsl', 'zenity', 'zip', + 'zlib', 'libzstd' + ] + buildroot: + rpms: + - flatpak-rpm-macros + - flatpak-runtime-config diff --git a/tests/test_flatpak_generator.py b/tests/test_flatpak_generator.py index f33817a..ee52775 100644 --- a/tests/test_flatpak_generator.py +++ b/tests/test_flatpak_generator.py @@ -19,173 +19,19 @@ from _fedmod.cli import _cli_commands log = logging.getLogger(__name__) -APPS_JSON = """\ -[{"flatpakAppId":"org.gnome.eog", - "name":"Eye of GNOME", - "summary":"Browse and rotate images", - "iconDesktopUrl":"/repo/appstream/x86_64/icons/128x128/org.gnome.eog.png"}, -{"flatpakAppId":"org.gnome.FeedReader", - "name":"FeedReader","summary":"RSS client for various webservices", - "iconDesktopUrl":"/repo/appstream/x86_64/icons/128x128/org.gnome.FeedReader.png"}] -""" - -EOG_YAML = """\ -app-id: org.gnome.eog -runtime: org.gnome.Platform -runtime-version: '3.30' -sdk: org.gnome.Sdk -branch: stable -command: eog -rename-desktop-file: eog.desktop -rename-appdata-file: eog.appdata.xml -rename-icon: eog -copy-icon: true -finish-args: - # X11 + XShm access - - --share=ipc - - --socket=x11 -""" - -EOG_JSON = """\ -{ - "app-id": "org.gnome.eog", - "runtime": "org.gnome.Platform", - "runtime-version": "3.30", - "sdk": "org.gnome.Sdk", - "branch": "stable", - "command": "eog", - "rename-desktop-file": "eog.desktop", - "rename-appdata-file": "eog.appdata.xml", - "rename-icon": "eog", - "copy-icon": true, - "finish-args": - /* X11 + XShm access */ - ["--share=ipc", - "--socket=x11"] -} -""" - -FLATPAK_RUNTIME_MODULEMD = """ -document: modulemd -version: 2 -data: - summary: Flatpak Runtime - description: This module defines two runtimes for Flatpaks. - license: - module: - - MIT - dependencies: - - buildrequires: - platform: [f29] - requires: - platform: [f29] - profiles: - runtime: - rpms: [ - 'flatpak-runtime-config', - 'abattis-cantarell-fonts', 'acl', 'libacl', 'adwaita-cursor-theme', - 'adwaita-icon-theme', 'alsa-lib', 'libargon2', 'aspell', - 'at-spi2-atk', 'at-spi2-core', 'atk', 'attr', 'libattr', 'audit-libs', - 'avahi-glib', 'avahi-libs', 'basesystem', 'bash', 'bluez-libs', - 'brotli', 'bzip2', 'bzip2-libs', 'ca-certificates', 'cairo', - 'cairo-gobject', 'cdparanoia-libs', 'chkconfig', 'clutter', - 'clutter-gst3', 'clutter-gtk', 'cogl', 'colord-libs', - 'compat-openssl10', 'compat-readline6', 'coreutils', - 'coreutils-common', 'cpio', 'cracklib', 'crypto-policies', - 'cryptsetup-libs', 'cups-libs', 'curl', 'libcurl', 'cyrus-sasl-lib', - 'dbus', 'dbus-common', 'dbus-daemon', 'dbus-libs', 'dbus-tools', - 'dbus-x11', 'dbus-glib', 'dconf', 'dejavu-fonts-common', - 'dejavu-sans-fonts', 'dejavu-sans-mono-fonts', 'dejavu-serif-fonts', - 'desktop-file-utils', 'libcom_err', 'libss', 'elfutils', - 'elfutils-default-yama-scope', 'elfutils-libelf', 'elfutils-libs', - 'emacs-filesystem', 'enchant', 'eosrei-emojione-fonts', 'expat', - 'fedora-release', 'fedora-gpg-keys', 'fedora-repos', 'file', - 'file-libs', 'filesystem', 'findutils', 'flac-libs', 'fontconfig', - 'fontpackages-filesystem', 'freetype', 'fribidi', 'gawk', 'gc', - 'libgcab1', 'libatomic', 'libgcc', 'libgfortran', 'libgomp', - 'libquadmath', 'libstdc++', 'gcr', 'gdbm', 'gdbm-libs', 'gdk-pixbuf2', - 'gdk-pixbuf2-modules', 'geoclue2', 'geoclue2-libs', 'gjs', - 'glib-networking', 'glib2', 'glibc', 'glibc-all-langpacks', - 'glibc-common', 'glibc-minimal-langpack', 'libnsl', 'gmp', - 'adwaita-gtk2-theme', 'gnome-themes-extra', 'gnu-free-fonts-common', - 'gnu-free-mono-fonts', 'gnu-free-sans-fonts', 'gnu-free-serif-fonts', - 'gnupg', 'gnupg2', 'gnupg2-smime', 'gnutls', 'gobject-introspection', - 'google-crosextra-caladea-fonts', 'google-crosextra-carlito-fonts', - 'google-noto-emoji-color-fonts', 'gpgme', 'graphite2', 'grep', - 'gsettings-desktop-schemas', 'gsm', 'gssdp', 'gstreamer1', - 'gstreamer1-plugins-bad-free', 'gstreamer1-plugins-base', 'gtk2', - 'gtk2-engines', 'gtk-update-icon-cache', 'gtk3', 'guile', 'gupnp', - 'gupnp-igd', 'gzip', 'harfbuzz', 'harfbuzz-icu', 'hicolor-icon-theme', - 'hunspell', 'hunspell-en-US', 'hwdata', 'hyphen', 'ibus-gtk2', - 'ibus-gtk3', 'ibus-libs', 'libicu', 'iptables-libs', 'iso-codes', - 'jasper-libs', 'jbigkit-libs', 'json-c', 'json-glib', 'qt-settings', - 'keyutils-libs', 'kmod-libs', 'krb5-libs', 'krb5-server', - 'krb5-workstation', 'libkadm5', 'lcms2', 'lcms2-utils', 'less', - 'libICE', 'libSM', 'libX11', 'libX11-common', 'libX11-xcb', - 'libXScrnSaver', 'libXau', 'libXcomposite', 'libXcursor', - 'libXdamage', 'libXdmcp', 'libXext', 'libXfixes', 'libXft', 'libXi', - 'libXinerama', 'libXpm', 'libXrandr', 'libXrender', 'libXt', - 'libXtst', 'libXv', 'libXxf86vm', 'libappstream-glib', 'libarchive', - 'libassuan', 'libasyncns', 'libatomic_ops', 'libcanberra', - 'libcanberra-gtk2', 'libcanberra-gtk3', 'libcap', 'libcap-ng', - 'libcroco', 'libdatrie', 'libdb', 'libdrm', 'libdvdnav', 'libdvdread', - 'libedit', 'libepoxy', 'liberation-fonts-common', - 'liberation-mono-fonts', 'liberation-sans-fonts', - 'liberation-serif-fonts', 'libev', 'libevdev', 'libexif', 'libffi', - 'libgcrypt', 'libglvnd', 'libglvnd-egl', 'libglvnd-gles', - 'libglvnd-glx', 'libglvnd-opengl', 'libgpg-error', 'libgudev', - 'libgusb', 'libidn2', 'libinput', 'libjpeg-turbo', 'turbojpeg', - 'libksba', 'libmetalink', 'libmng', 'libmodman', 'libmpc', - 'libmpcdec', 'libnice', 'libnotify', 'libnsl2', 'libogg', 'libpcap', - 'libpciaccess', 'libpng', 'libproxy', 'python2-libproxy', 'libpsl', - 'libpwquality', 'librsvg2', 'librsvg2-tools', 'libsamplerate', - 'libseccomp', 'libsecret', 'libselinux', 'libsemanage', 'libsepol', - 'libsigsegv', 'libsndfile', 'libsoup', 'libsrtp', 'libssh', - 'libstemmer', 'libtasn1', 'libtdb', 'libthai', 'libtheora', 'libtiff', - 'libtirpc', 'libtool-ltdl', 'libunistring', 'libusb', 'libusbx', - 'libutempter', 'libvdpau', 'libverto', 'libverto-libev', 'libvisual', - 'libvorbis', 'libwacom', 'libwacom-data', 'libwebp', 'libxcb', - 'libxcrypt', 'libxkbcommon', 'libxkbcommon-x11', 'libxml2', - 'python2-libxml2', 'libxshmfence', 'libxslt', 'llvm-libs', - 'logrotate', 'device-mapper', 'device-mapper-libs', 'lz4-libs', - 'ModemManager-glib', 'make', 'mesa-dri-drivers', 'mesa-filesystem', - 'mesa-libEGL', 'mesa-libGL', 'mesa-libgbm', 'mesa-libglapi', - 'mesa-libxatracker', 'mesa-vulkan-drivers', 'glx-utils', - 'mesa-libGLU', 'mlocate', 'mozjs60', 'mpfr', 'mpg123-libs', 'mtdev', - 'mythes', 'ncompress', 'ncurses', 'ncurses-base', - 'ncurses-compat-libs', 'ncurses-libs', 'nettle', 'libnghttp2', 'npth', - 'nspr', 'nss', 'nss-sysinit', 'nss-tools', 'nss-softokn', - 'nss-softokn-freebl', 'nss-util', 'ocl-icd', 'openal-soft', - 'openldap', 'openssl', 'openssl-libs', 'opus', 'orc', 'p11-kit', - 'p11-kit-trust', 'pam', 'pango', 'pcre', 'pcre-cpp', 'pcre2', - 'pcre2-utf16', 'pcre2-utf32', 'pinentry', 'pixman', 'libpkgconf', - 'pkgconf', 'pkgconf-m4', 'pkgconf-pkg-config', 'popt', 'procps-ng', - 'publicsuffix-list-dafsa', 'pulseaudio-libs', 'pulseaudio-libs-glib2', - 'pulseaudio-utils', 'python3-cairo', 'python3-gobject', - 'python3-gobject-base', 'python-pip-wheel', 'python-setuptools-wheel', - 'python2-setuptools', 'python-unversioned-command', 'python2', - 'python2-libs', 'python3', 'python3-libs', 'qrencode-libs', - 'readline', 'rest', 'rpcgen', 'SDL2', 'SDL2_image', 'SDL2_mixer', - 'SDL2_net', 'SDL2_ttf', 'sed', 'setup', 'xml-common', 'shadow-utils', - 'shared-mime-info', 'sound-theme-freedesktop', 'soundtouch', 'speex', - 'speexdsp', 'spirv-tools-libs', 'sqlite-libs', 'systemd', - 'systemd-libs', 'systemd-pam', 'tar', 'info', 'tzdata', 'unzip', - 'libblkid', 'libfdisk', 'libmount', 'libsmartcols', 'libuuid', - 'util-linux', 'vte-profile', 'vte291', 'vulkan-loader', - 'vulkan-validation-layers', 'libwayland-client', 'libwayland-cursor', - 'libwayland-egl', 'libwayland-server', 'webkit2gtk3', - 'webkit2gtk3-jsc', 'webrtc-audio-processing', 'which', 'woff2', - 'words', 'xcb-util', 'xcb-util-cursor', 'xcb-util-image', - 'xcb-util-keysyms', 'xcb-util-renderutil', 'xcb-util-wm', - 'xdg-user-dirs', 'xdg-utils', 'xkeyboard-config', 'xz', 'xz-libs', - 'xz-lzma-compat', 'yelp', 'yelp-libs', 'yelp-xsl', 'zenity', 'zip', - 'zlib', 'libzstd' - ] - buildroot: - rpms: - - flatpak-rpm-macros - - flatpak-runtime-config -""" +testfiles_dir = os.path.join(os.path.dirname(__file__), 'files', 'flatpak') + +with open(os.path.join(testfiles_dir, 'apps.json')) as f: + APPS_JSON = f.read() + +with open(os.path.join(testfiles_dir, 'eog.yaml')) as f: + EOG_YAML = f.read() + +with open(os.path.join(testfiles_dir, 'eog.json')) as f: + EOG_JSON = f.read() + +with open(os.path.join(testfiles_dir, 'flatpak-runtime.mmd.yaml')) as f: + FLATPAK_RUNTIME_MODULEMD = f.read() @contextmanager