summaryrefslogtreecommitdiffstats
path: root/utils/setools/test.sh
blob: 2cf30dbbce00f9e2989de5da0c42c6ac5748c142 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

[ "$1" = python3-setools ] || exit 0

python3 - << 'EOF'
import setools

# Verify the module loads and basic query classes are accessible
assert hasattr(setools, 'SELinuxPolicy'), \
    "setools missing SELinuxPolicy class"
assert hasattr(setools, 'BoolQuery'), \
    "setools missing BoolQuery class"
assert hasattr(setools, 'TypeQuery'), \
    "setools missing TypeQuery class"
assert hasattr(setools, 'RoleQuery'), \
    "setools missing RoleQuery class"
assert hasattr(setools, 'UserQuery'), \
    "setools missing UserQuery class"
EOF