File: 10-mandatory-6.1.15.t

package info (click to toggle)
libcsaf-perl 0.26-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,280 kB
  • sloc: perl: 7,583; makefile: 2
file content (56 lines) | stat: -rw-r--r-- 1,263 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
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
51
52
53
54
55
56
#!perl

use 5.010001;
use strict;
use warnings;
use Test::More;

use FindBin '$RealBin';
use lib "$RealBin/lib";

use Test::CSAF qw(exec_validator_mandatory_test);
use CSAF;

# 6.1.15 Translator

# It MUST be tested that /document/source_lang is present and set if the value translator is used for /document/publisher/category.

# The relevant path for this test is:

#   /document/source_lang

# Fail test:

#  "document": {
#    // ...
#    "publisher": {
#      "category": "translator",
#      "name": "CSAF TC Translator",
#      "namespace": "https://csaf.io/translator"
#    },
#    "title": "Mandatory test: Translator (failing example 1)",
#    // ...
#  }


my $csaf = CSAF->new;

$csaf->document->title('Mandatory test: Translator (failing example 1)');
$csaf->document->category('csaf_security_advisory');
$csaf->document->publisher(
    category  => 'translator',
    name      => 'CSAF TC Translator',
    namespace => 'https://csaf.io/translator'
);

my $tracking = $csaf->document->tracking(
    id                   => 'CSAF:2023-001',
    status               => 'final',
    version              => '1.0.0',
    initial_release_date => 'now',
    current_release_date => 'now'
);

exec_validator_mandatory_test($csaf, '6.1.15');

done_testing;