rpm-ostree/tests/check/test-lib-introspection.sh
Jonathan Lebon 206ae24d4e tests: Bump to Python 3 only
This bumps the requirement on the controlling host to Python 3 only.
It also bumps the requirement on the target host to Python 3 as well
since FCOS doesn't ship Python 2 right now.

Though we'll need to eventually drop all Python usage anyway, but at
least let's get tests passing on FCOS first. (See related previous
patch).

Closes: #1828
Approved by: cgwalters
2019-05-08 19:02:32 +00:00

59 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
#
# Copyright (C) 2014 Colin Walters <walters@verbum.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
set -e
. ${commondir}/libtest.sh
echo "1..2"
set -x
if ! skip_one_with_asan; then
cat >test-rpmostree-gi-arch <<EOF
#!/usr/bin/python3
import gi
gi.require_version("RpmOstree", "1.0")
from gi.repository import RpmOstree
assert RpmOstree.get_basearch() == 'x86_64'
assert RpmOstree.varsubst_basearch('http://example.com/foo/\${basearch}/bar') == 'http://example.com/foo/x86_64/bar'
EOF
chmod a+x test-rpmostree-gi-arch
case $(arch) in
x86_64) ./test-rpmostree-gi-arch
echo "ok rpmostree arch"
;;
*) echo "ok # SKIP Skipping RPM architecture test on $(arch)"
esac
fi
if ! skip_one_with_asan; then
cat >test-rpmostree-gi <<EOF
#!/usr/bin/python3
import gi
gi.require_version("RpmOstree", "1.0")
from gi.repository import RpmOstree
assert RpmOstree.check_version(2017, 6)
# If this fails for you, please come back in a time machine and say hi
assert not RpmOstree.check_version(3000, 1)
EOF
chmod a+x test-rpmostree-gi
./test-rpmostree-gi
echo "ok rpmostree version"
fi