psss / tests / selinux

Forked from tests/selinux 6 years ago
Clone

9d4050e semanage-port-add-delete-problems: Check for MAC_POLICY_LOAD after semanage

Authored and Committed by plautrba 5 years ago
    semanage-port-add-delete-problems: Check for MAC_POLICY_LOAD after semanage
    
    We need to check whether a new policy is loaded after 'semanage port -a ...'.
    The best way to do it is to check whether kernel reported MAC_POLICY_LOAD.
    
    The original check was error prone.
    
    Fixes:
    [   PASS   ] :: Command 'ausearch -m user_avc -ts 03/13/2019 08:10:47 > /tmp/tmp.3RAR6INhvL' (Expected 0,1, got 0)
    [  BEGIN   ] :: Running 'cat /tmp/tmp.3RAR6INhvL'
    ----
    time->Wed Mar 13 08:10:53 2019
    type=USER_AVC msg=audit(1552479053.819:1407): pid=698 uid=81 auid=4294967295 ses=4294967295 subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 msg='avc:  received policyload notice (seqno=65)  exe="/usr/bin/dbus-daemon" sauid=81 hostname=? addr=? terminal=?'
    [   FAIL   ] :: number of lines in /tmp/tmp.3RAR6INhvL should be 0 (Assert: expected 0, got 3)