-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_tls_api.py
100 lines (84 loc) · 3.84 KB
/
test_tls_api.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#
# Copyright (C) 2019-2024, HENSOLDT Cyber GmbH
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# For commercial licensing, contact: [email protected]
#
import pytest, sys
import test_parser as parser
TEST_NAME = 'test_tls_api'
OS_Tls_MODE_LIBRARY = 1
# AUTOGENERATED TEST FUNCTIONS BELOW -------------------------------------------
def test_OS_Tls_init_pos_0(boot_with_proxy, tls_server):
"""
Positive tests for OS_Tls_init(), covering the valid ways of using this
function.
"""
parser.check_test(boot_with_proxy(TEST_NAME), 30, 'test_OS_Tls_init_pos')
def test_OS_Tls_init_neg_0(boot_with_proxy, tls_server):
"""
Negative tests for OS_Tls_init(), covering the invalid ways of using this
function thus verifying that it returns error codes instead of crashing
"""
parser.check_test(boot_with_proxy(TEST_NAME), 5, 'test_OS_Tls_init_neg')
def test_OS_Tls_free_pos_0(boot_with_proxy, tls_server):
"""
Positive tests for OS_Tls_free(), covering the valid ways of using this
function.
"""
parser.check_test(boot_with_proxy(TEST_NAME), 5, 'test_OS_Tls_free_pos')
def test_OS_Tls_free_neg_0(boot_with_proxy, tls_server):
"""
Negative tests for OS_Tls_free(), covering the invalid ways of using this
function thus verifying that it returns error codes instead of crashing
"""
parser.check_test(boot_with_proxy(TEST_NAME), 5, 'test_OS_Tls_free_neg')
def test_OS_Tls_handshake_pos_0(boot_with_proxy, tls_server):
"""
Positive tests for OS_Tls_handshake(), covering the valid ways of using this
function.
"""
parser.check_test(boot_with_proxy(TEST_NAME), 30, 'test_OS_Tls_handshake_pos', 'mode=%i' % OS_Tls_MODE_LIBRARY)
def test_OS_Tls_handshake_neg_0(boot_with_proxy, tls_server):
"""
Negative tests for OS_Tls_handshake(), covering the invalid ways of using
this function thus verifying that it returns error codes instead of crashing
"""
parser.check_test(boot_with_proxy(TEST_NAME), 5, 'test_OS_Tls_handshake_neg', 'mode=%i' % OS_Tls_MODE_LIBRARY)
def test_OS_Tls_write_neg_0(boot_with_proxy, tls_server):
"""
Negative tests for OS_Tls_write(), covering the invalid ways of using this
function thus verifying that it returns error codes instead of crashing
"""
parser.check_test(boot_with_proxy(TEST_NAME), 5, 'test_OS_Tls_write_neg', 'mode=%i' % OS_Tls_MODE_LIBRARY)
def test_OS_Tls_write_pos_0(boot_with_proxy, tls_server):
"""
Positive tests for OS_Tls_write(), covering the valid ways of using this
function.
"""
parser.check_test(boot_with_proxy(TEST_NAME), 5, 'test_OS_Tls_write_pos', 'mode=%i' % OS_Tls_MODE_LIBRARY)
def test_OS_Tls_read_neg_0(boot_with_proxy, tls_server):
"""
Negative tests for OS_Tls_read(), covering the invalid ways of using this
function thus verifying that it returns error codes instead of crashing
"""
parser.check_test(boot_with_proxy(TEST_NAME), 5, 'test_OS_Tls_read_neg', 'mode=%i' % OS_Tls_MODE_LIBRARY)
def test_OS_Tls_read_pos_0(boot_with_proxy, tls_server):
"""
Positive tests for OS_Tls_read(), covering the valid ways of using this
function.
"""
parser.check_test(boot_with_proxy(TEST_NAME), 5, 'test_OS_Tls_read_pos', 'mode=%i' % OS_Tls_MODE_LIBRARY)
def test_OS_Tls_reset_neg_0(boot_with_proxy, tls_server):
"""
Negative tests for OS_Tls_reset(), covering the invalid ways of using this
function thus verifying that it returns error codes instead of crashing
"""
parser.check_test(boot_with_proxy(TEST_NAME), 5, 'test_OS_Tls_reset_neg', 'mode=%i' % OS_Tls_MODE_LIBRARY)
def test_OS_Tls_reset_pos_0(boot_with_proxy, tls_server):
"""
Positive tests for OS_Tls_reset(), covering the valid ways of using this
function.
"""
parser.check_test(boot_with_proxy(TEST_NAME), 30, 'test_OS_Tls_reset_pos', 'mode=%i' % OS_Tls_MODE_LIBRARY)