File: test_schema_version.sh

package info (click to toggle)
openscap 1.4.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 125,040 kB
  • sloc: xml: 527,109; ansic: 91,390; sh: 19,789; python: 2,515; perl: 444; makefile: 49
file content (50 lines) | stat: -rwxr-xr-x 1,063 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env bash

# Copyright 2015 Red Hat Inc., Durham, North Carolina.
# All Rights Reserved.
#
# OpenScap Test Suite
#
# Authors:
#      Jan Černý <jcerny@redhat.com>

. $builddir/tests/test_common.sh

# Test cases.

set -e -o pipefail

TEST="./test_schema_version"

function test_comparing_schema_versions {
# format: version_1 version_2 result
    $TEST 5.2 5.2 0
    $TEST 4.2 5.2 -1
    $TEST 6.2 4.2 1
    $TEST 5.10 5.11 -1
    $TEST 5.11 5.10 1
    $TEST 6.0.1 6.0 1
    $TEST 6.0.1 6.0.2 -1
    $TEST 6.0.2 6.1.2 -1
    $TEST 6.13.4 6.13 1
    $TEST 999.999.999 999.999.998 1
    $TEST 5.11.1:1.0 5.11.1:1.0 0
    $TEST 5.11.1:1.1 5.11.1:1.2 -1
    $TEST 5.11.1:2.1 5.11.1:1.2 1
    $TEST 5.11.2:1.0 5.11.1:1.0 1
    $TEST 5.11.2:1.1 5.12.1:1.1 -1
    $TEST 6.3:8.7.9 6.3:8.7.10 -1
    $TEST 13.0:1.2.3 13.0:1.3 -1
    $TEST 13.0:1.2.3 13.0:1.2 1
    $TEST 42.42.42:42.42.42 42.42.42:42.42.42 0
}

# Testing.

test_init

if [ -z ${CUSTOM_OSCAP+x} ] ; then
    test_run "test_comparing_schema_versions" test_comparing_schema_versions
fi

test_exit