4 TESTDIR
="$(readlink -f "$(dirname "$0")")"
8 configarchitecture 'amd64'
10 insertpackage 'unstable' 'module-init-tools' 'amd64' '1.0' 'Depends: libkmod2 (= 21-1)'
11 insertpackage 'unstable' 'libkmod2' 'amd64' '0.22-1'
12 insertinstalledpackage 'module-init-tools' 'amd64' '0.1'
16 # this test only works if the python-apt is build against the same
17 # ABI version as the apt we are testing here
18 PYAPT_LIB_VER=$(runpython3 -c 'import apt_pkg;print(apt_pkg.LIB_VERSION)' 2>/dev/null || true)
19 if [ ! -f $LIBRARYPATH/libapt-pkg.so.$PYAPT_LIB_VER ]; then
20 msgskip "python
-apt build with the wrong library version
: $PYAPT_LIB_VER"
24 # we can not test this using our normal sh tests
29 def in_valid_state(pkg):
30 return (pkg.marked_keep or
34 pkg.marked_downgrade or
38 pkgname="module
-init-tools"
39 if not in_valid_state(cache[pkgname]):
40 print("the
test is broken
, %s should be
in a valid state
" % pkgname)
43 if not in_valid_state(cache[pkgname]):
44 print("package
%s is
in a heisen
-state" % pkgname)
48 testsuccess runpython3 test.py