-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_keystore.py
88 lines (68 loc) · 2.59 KB
/
test_keystore.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
#
# Copyright (C) 2019-2024, HENSOLDT Cyber GmbH
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# For commercial licensing, contact: [email protected]
#
import pytest
import sys
import logs # logs module from the common directory in TA
import os
import re
import time
import test_parser as parser
test_system = "test_keystore"
# based in the profiling in CI, 180 sec should be enough. Most tests finish
# well under 60 seconds, just sometimes tests can take much longer. Might be
# related to CI system load in the end.
timeout = 180
#-------------------------------------------------------------------------------
def test_key_store_unit_tests(boot_with_proxy):
"""
Run unit tests (import, read, delete) with KeyStore (using FAT file system)
Scenario 1: local keystore
"""
parser.check_test(boot_with_proxy(test_system),
timeout,
'keyStoreUnitTests',
occurrences=2)
#-------------------------------------------------------------------------------
def test_key_store_integration_tests_AES(boot_with_proxy):
"""
import AES-256 key to KeyStore using (using FAT file system)
Scenario 3: local keystore
"""
parser.check_test(boot_with_proxy(test_system),
timeout,
'testKeyStoreAES',
occurrences=2)
#-------------------------------------------------------------------------------
def test_key_store_integration_tests_keyPair(boot_with_proxy):
"""
import RSA-128 key pair to KeyStore using FAT file system
Scenario 5: local keystore
"""
parser.check_test(boot_with_proxy(test_system),
timeout,
'testKeyStoreKeyPair')
#-------------------------------------------------------------------------------
def test_key_store_multi_instance_tests_copy(boot_with_proxy):
"""
Copy key from one keystore to another (using FAT file system)
Scenario 7: local keystore
"""
parser.check_test(boot_with_proxy(test_system),
timeout,
'keyStoreCopyKeyTest',
occurrences=2)
#-------------------------------------------------------------------------------
def test_key_store_multi_instance_tests_move(boot_with_proxy):
"""
Move key from one keystore to another (using FAT file system)
Scenario 9: local keystore
"""
parser.check_test(boot_with_proxy(test_system),
timeout,
'keyStoreMoveKeyTest',
occurrences=2)