-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_certserver.py
84 lines (74 loc) · 3.56 KB
/
test_certserver.py
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#
# Copyright (C) 2020-2024, HENSOLDT Cyber GmbH
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# For commercial licensing, contact: [email protected]
#
import pytest
import test_parser as parser
def test_CertServer_initChain_pos(boot):
"""
Positive tests for CertServer_initChain(), covering the valid ways of using this
function.
"""
parser.check_test(boot(), 3, 'test_CertServer_initChain_pos', 'cid=101')
parser.check_test(boot(), 3, 'test_CertServer_initChain_pos', 'cid=102')
parser.check_test(boot(), 3, 'test_CertServer_initChain_pos', 'cid=103')
def test_CertServer_initChain_neg(boot):
"""
Negative tests for CertServer_initChain(), covering the invalid ways of using
this function thus verifying that it returns error codes instead of crashing.
"""
parser.check_test(boot(), 3, 'test_CertServer_initChain_neg', 'cid=101')
parser.check_test(boot(), 3, 'test_CertServer_initChain_neg', 'cid=102')
parser.check_test(boot(), 3, 'test_CertServer_initChain_neg', 'cid=103')
def test_CertServer_addCertToChain_pos(boot):
"""
Positive tests for CertServer_addCertToChain(), covering the valid ways of using
this function.
"""
parser.check_test(boot(), 3, 'test_CertServer_addCertToChain_pos', 'cid=101')
parser.check_test(boot(), 3, 'test_CertServer_addCertToChain_pos', 'cid=102')
parser.check_test(boot(), 3, 'test_CertServer_addCertToChain_pos', 'cid=103')
def test_CertServer_addCertToChain_neg(boot):
"""
Negative tests for CertServer_addCertToChain(), covering the invalid ways of
using this function thus verifying that it returns error codes instead of
crashing.
"""
parser.check_test(boot(), 3, 'test_CertServer_addCertToChain_neg', 'cid=101')
parser.check_test(boot(), 3, 'test_CertServer_addCertToChain_neg', 'cid=102')
parser.check_test(boot(), 3, 'test_CertServer_addCertToChain_neg', 'cid=103')
def test_CertServer_verifyChain_pos(boot):
"""
Positive tests for CertServer_verifyChain(), covering the valid ways of using
this function.
"""
parser.check_test(boot(), 3, 'test_CertServer_verifyChain_pos', 'cid=102')
parser.check_test(boot(), 3, 'test_CertServer_verifyChain_pos', 'cid=101')
parser.check_test(boot(), 3, 'test_CertServer_verifyChain_pos', 'cid=103')
def test_CertServer_verifyChain_neg(boot):
"""
Negative tests for CertServer_verifyChain(), covering the invalid ways of using
this function thus verifying that it returns error codes instead of crashing.
"""
parser.check_test(boot(), 5, 'test_CertServer_verifyChain_neg', 'cid=102')
parser.check_test(boot(), 5, 'test_CertServer_verifyChain_neg', 'cid=101')
parser.check_test(boot(), 5, 'test_CertServer_verifyChain_neg', 'cid=103')
def test_CertServer_freeChain_pos(boot):
"""
Positive tests for CertServer_freeChain(), covering the valid ways of using this
function.
"""
parser.check_test(boot(), 3, 'test_CertServer_freeChain_pos', 'cid=102')
parser.check_test(boot(), 3, 'test_CertServer_freeChain_pos', 'cid=101')
parser.check_test(boot(), 3, 'test_CertServer_freeChain_pos', 'cid=103')
def test_CertServer_freeChain_neg(boot):
"""
Negative tests for CertServer_freeChain(), covering the invalid ways of using
this function thus verifying that it returns error codes instead of crashing.
"""
parser.check_test(boot(), 3, 'test_CertServer_freeChain_neg', 'cid=102')
parser.check_test(boot(), 3, 'test_CertServer_freeChain_neg', 'cid=101')
parser.check_test(boot(), 3, 'test_CertServer_freeChain_neg', 'cid=103')