File: test_api_cvss.sh

package info (click to toggle)
openscap 1.0.9-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 129,588 kB
  • ctags: 26,325
  • sloc: xml: 611,156; ansic: 90,367; sh: 26,693; makefile: 2,463; python: 804; perl: 445; cpp: 123
file content (41 lines) | stat: -rwxr-xr-x 744 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/env bash

# Copyright 2009 Red Hat Inc., Durham, North Carolina.
# All Rights Reserved.
#
# OpenScap CVSS Module Test Suite.
#
# Authors:
#      Maros Barabas <mbarabas@redhat.com>
#      Ondrej Moris <omoris@redhat.com



. $srcdir/../../test_common.sh

# Test cases.

# check vector against expected value
function test_api_cvss_vector {
    ./test_api_cvss --base $A $B $C $D $E $F >/dev/null

    local ret vector value v
    ret=0

    while read vector value; do
        v=`./test_api_cvss $vector`
        [ "$value" != "$v" ] && ret=1
        echo "$vector --> $v ($value)"
    done <vectors.txt

    return $ret
}

# Testing.

test_init "test_api_cvss.log"

test_run "test_api_cvss_vector" test_api_cvss_vector

test_exit