-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.cmake
157 lines (144 loc) · 5.42 KB
/
tests.cmake
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# © 2024 AO Kaspersky Lab
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Initialize CMake library for KasperskyOS SDK.
include(platform)
initialize_platform(FORCE_STATIC)
# Tools for using NK parser.
include(platform/nk)
# Tools to generate project for unit tests on KasperskyOS
include(test-generator/test_generator)
# Add a package with the VFS program implementations.
find_package(vfs REQUIRED)
include_directories(${vfs_INCLUDE})
# Add a package with prebuilt VFS program implementations.
find_package(precompiled_vfs REQUIRED)
# Add a package with the Dhcpcd program implementation.
find_package(rump REQUIRED COMPONENTS DHCPCD_ENTITY)
include_directories(${rump_INCLUDE})
# Set additional properties for precompiled_vfsVfsSdCardFs program.
set_target_properties(${precompiled_vfsVfsSdCardFs}
PROPERTIES
EXTRA_ENV "
VFS_FILESYSTEM_BACKEND: server:kl.VfsSdCardFs"
EXTRA_ARGS "
- -l
- devfs /dev devfs 0
- -l
- romfs /etc romfs ro"
)
# Set additional properties for precompiled_vfsVfsNet program.
set_target_properties(${precompiled_vfsVfsNet}
PROPERTIES
EXTRA_ENV "
VFS_FILESYSTEM_BACKEND: server:kl.VfsNet"
EXTRA_ARGS "
- -l
- devfs /dev devfs 0
- -l
- romfs /etc romfs ro"
)
# Set additional properties for rump_DHCPCD_ENTITY program.
set_target_properties(${rump_DHCPCD_ENTITY}
PROPERTIES
${vfs_ENTITY}_REPLACEMENT ""
DEPENDS_ON_ENTITY "${precompiled_vfsVfsSdCardFs};${precompiled_vfsVfsNet}"
EXTRA_ENV "
VFS_FILESYSTEM_BACKEND: client{fs->net}:kl.VfsSdCardFs
VFS_NETWORK_BACKEND: client:kl.VfsNet"
EXTRA_ARGS "
- '-4'
- '-f'
- /etc/dhcpcd.conf"
)
# Filtered tests:
# No Ipv6 loopback on KasperskyOS:
# AddressSortingTest.*Ipv6Loopback*,
# ResolveAddressTest.LocalhostResultHasIPv6First
# Death Tests are not supported on KasperskyOS:
# *GrpcToolTest.NoCommand*
# *GrpcToolTest.InvalidCommand*
# *GrpcToolTest.HelpCommand*
# *GrpcToolTest.TooFewArguments*
# *GrpcToolTest.TooManyArguments*
# *GrpcToolTest.CallCommandWithBadMetadata*
# No HOME directory on KasperskyOS:
# CredentialsTest.TestGetWellKnownGoogleCredentialsFilePath
# KasperskyOS does not support SO_REUSEADDR and does not allow binding the same address and port twice:
# ServerBuilderTest.CreateServerRepeatedPort
# Too mach objects create VFS_SERVER_OCAP Error code 28 Quota exceeded:
# PortSharingEnd2endTest.*
# GrpcToolTest.*
# AltsConcurrentConnectivityTest.*
# ClientCallbackEnd2endTest.*
# SingleBalancerTest.*
# execv is not implemented on KasperskyOS:
# HttpRequestTest.*
# HttpsCliTest.*
# Stack trace is not enabled on KasperskyOS:
# ExamineStackTest.*
# Flaky:
# CancelDuringAresQuery.TestHitDeadlineAndDestroyChannelDuringAresResolutionWithZeroQueryTimeoutIsGraceful
# ClientInterceptorsStreamingEnd2endTest.*
# GrpcAuthzEnd2EndTest.*
# IdleFilterStateTest.*
# EchoTest.*
# ServerBuilderTest.*
# StreamsNotSeenTest.*
# XdsCredentialsEnd2EndFallback*
string(JOIN : FILTERED_TESTS
AddressSortingTest.*Ipv6Loopback*
ResolveAddressTest.LocalhostResultHasIPv6First
CredentialsTest.TestGetWellKnownGoogleCredentialsFilePath
ServerBuilderTest.CreateServerRepeatedPort
*PortSharingEnd2endTest.*
HybridEnd2endTest.AsyncRequestStreamResponseStream_*
CancelDuringAresQuery.TestHitDeadlineAndDestroyChannelDuringAresResolutionWithZeroQueryTimeoutIsGraceful
ClientInterceptorsStreamingEnd2endTest.ServerStreamingHijackingTest
HttpRequestTest.*
HttpsCliTest.*
GrpcToolTest.*
*AsyncEnd2endTest*
AltsConcurrentConnectivityTest.*
ClientCallbackEnd2endTest.*
ExamineStackTest.*
SingleBalancerTest.*
GrpcAuthzEnd2EndTest.*
IdleFilterStateTest.*
EchoTest.*
ServerBuilderTest.*
StreamsNotSeenTest.*
XdsCredentialsEnd2EndFallback*
)
set(KOS_TEST_DIR "${CMAKE_SOURCE_DIR}/test/kos")
include(${KOS_TEST_DIR}/cmake/disabled_cpp_tests.cmake)
include(${KOS_TEST_DIR}/cmake/add_gtest.cmake)
function(add_tests_kos TESTS)
foreach(TEST ${TESTS})
if(NOT (${TEST} IN_LIST DISABLED_CXX_TESTS))
add_gtest_target(${TEST}
DEPENDS_ON ${precompiled_vfsVfsSdCardFs}
${precompiled_vfsVfsNet}
${rump_DHCPCD_ENTITY}
ENV_VARIABLES VFS_FILESYSTEM_BACKEND=client:kl.VfsSdCardFs
VFS_NETWORK_BACKEND=client:kl.VfsNet
ARGS --gtest_filter=-${FILTERED_TESTS}
FILES ${KOS_TEST_DIR}/resources/etc/dhcpcd.conf
${KOS_TEST_DIR}/resources/etc/hosts
${KOS_TEST_DIR}/resources/etc/resolv.conf
FILES_TO_COPY ${CMAKE_SOURCE_DIR}/src/core/tsi/test_creds:src/core/tsi
${CMAKE_SOURCE_DIR}/test/core/security/authorization/test_policies:test/core/security/authorization
${CMAKE_SOURCE_DIR}/test/core/tsi/test_creds:test/core/tsi
)
endif()
endforeach()
endfunction()