File: test_oval.py

package info (click to toggle)
scap-security-guide 0.1.76-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 110,644 kB
  • sloc: xml: 241,883; sh: 73,777; python: 32,527; makefile: 27
file content (21 lines) | stat: -rw-r--r-- 700 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import pytest

import os
import ssg.oval

data_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "data"))
rule_dir_oval = os.path.join(data_dir, "group_dir", "rule_dir", "oval")
rhel_oval = os.path.join(rule_dir_oval, "rhel.xml")
shared_oval = os.path.join(rule_dir_oval, "shared.xml")

def test_applicable_platforms():
    rap = ssg.oval.applicable_platforms(rhel_oval)
    assert len(rap) == 1
    assert 'Red Hat Enterprise Linux 9' in rap

    sap = ssg.oval.applicable_platforms(shared_oval)
    assert len(sap) == 4
    assert 'multi_platform_rhel' in sap
    assert 'multi_platform_fedora' in sap
    assert 'multi_platform_debian' in sap
    assert 'multi_platform_ubuntu' in sap