blob: 44e8e6fe66749dbae3118bfea975b47561393107 (
plain)
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
158
159
160
161
162
163
164
165
166
167
168
|
###############################################################################
# gmock_marsio
###############################################################################
add_library(gmock_marsio gmock_marsio.cpp)
target_include_directories(gmock_marsio PUBLIC /opt/mrzcpd/include)
###############################################################################
# temp_platform
###############################################################################
add_library(temp_platform
${CMAKE_SOURCE_DIR}/platform/src/policy.cpp
${CMAKE_SOURCE_DIR}/platform/src/health_check.cpp
${CMAKE_SOURCE_DIR}/platform/src/sce.cpp
${CMAKE_SOURCE_DIR}/platform/src/packet_io.cpp
${CMAKE_SOURCE_DIR}/platform/src/global_metrics.cpp
${CMAKE_SOURCE_DIR}/platform/src/sf_metrics.cpp
${CMAKE_SOURCE_DIR}/platform/src/sf_status.cpp)
target_include_directories(temp_platform PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(temp_platform PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(temp_platform PUBLIC common pthread cjson maatframe MESA_prof_load MESA_field_stat gmock_marsio)
###############################################################################
# gtest_ctrl_pkt_opening
###############################################################################
add_executable(gtest_ctrl_pkt_opening gtest_ctrl_pkt_opening.cpp)
target_include_directories(gtest_ctrl_pkt_opening PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_ctrl_pkt_opening PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_ctrl_pkt_opening temp_platform gtest)
###############################################################################
# gtest_ctrl_pkt_active
###############################################################################
add_executable(gtest_ctrl_pkt_active gtest_ctrl_pkt_active.cpp)
target_include_directories(gtest_ctrl_pkt_active PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_ctrl_pkt_active PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_ctrl_pkt_active temp_platform gtest)
###############################################################################
# gtest_data_pkt_stee_bypass
###############################################################################
add_executable(gtest_data_pkt_stee_bypass gtest_data_pkt_stee_bypass.cpp)
target_include_directories(gtest_data_pkt_stee_bypass PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_data_pkt_stee_bypass PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_data_pkt_stee_bypass temp_platform gtest)
###############################################################################
# gtest_data_pkt_stee_block
###############################################################################
add_executable(gtest_data_pkt_stee_block gtest_data_pkt_stee_block.cpp)
target_include_directories(gtest_data_pkt_stee_block PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_data_pkt_stee_block PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_data_pkt_stee_block temp_platform gtest)
###############################################################################
# gtest_data_pkt_stee_forward
###############################################################################
add_executable(gtest_data_pkt_stee_forward gtest_data_pkt_stee_forward.cpp)
target_include_directories(gtest_data_pkt_stee_forward PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_data_pkt_stee_forward PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_data_pkt_stee_forward temp_platform gtest)
###############################################################################
# gtest_data_pkt_stee_rx_egress
###############################################################################
add_executable(gtest_data_pkt_stee_rx_egress gtest_data_pkt_stee_rx_egress.cpp)
target_include_directories(gtest_data_pkt_stee_rx_egress PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_data_pkt_stee_rx_egress PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_data_pkt_stee_rx_egress temp_platform gtest)
###############################################################################
# gtest_data_pkt_mirr_bypass
###############################################################################
add_executable(gtest_data_pkt_mirr_bypass gtest_data_pkt_mirr_bypass.cpp)
target_include_directories(gtest_data_pkt_mirr_bypass PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_data_pkt_mirr_bypass PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_data_pkt_mirr_bypass temp_platform gtest)
###############################################################################
# gtest_data_pkt_mirr_block
###############################################################################
add_executable(gtest_data_pkt_mirr_block gtest_data_pkt_mirr_block.cpp)
target_include_directories(gtest_data_pkt_mirr_block PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_data_pkt_mirr_block PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_data_pkt_mirr_block temp_platform gtest)
###############################################################################
# gtest_data_pkt_mirr_forward
###############################################################################
add_executable(gtest_data_pkt_mirr_forward gtest_data_pkt_mirr_forward.cpp)
target_include_directories(gtest_data_pkt_mirr_forward PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_data_pkt_mirr_forward PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_data_pkt_mirr_forward temp_platform gtest)
###############################################################################
# gtest_data_pkt_mirr_rx_drop
###############################################################################
add_executable(gtest_data_pkt_mirr_rx_drop gtest_data_pkt_mirr_rx_drop.cpp)
target_include_directories(gtest_data_pkt_mirr_rx_drop PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_data_pkt_mirr_rx_drop PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_data_pkt_mirr_rx_drop temp_platform gtest)
###############################################################################
# gtest_data_pkt_error_bypass
###############################################################################
add_executable(gtest_data_pkt_error_bypass gtest_data_pkt_error_bypass.cpp)
target_include_directories(gtest_data_pkt_error_bypass PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_data_pkt_error_bypass PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_data_pkt_error_bypass temp_platform gtest)
###############################################################################
# gtest_mix_pkt_stee_forward
###############################################################################
add_executable(gtest_mix_pkt_stee_forward gtest_mix_pkt_stee_forward.cpp)
target_include_directories(gtest_mix_pkt_stee_forward PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_mix_pkt_stee_forward PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_mix_pkt_stee_forward temp_platform gtest)
###############################################################################
# gtest_vlan_encapsulate
###############################################################################
add_executable(gtest_vlan_encapsulate gtest_vlan_encapsulate.cpp)
target_include_directories(gtest_vlan_encapsulate PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_vlan_encapsulate PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_vlan_encapsulate temp_platform gtest)
###############################################################################
# gtest_discover_tests
###############################################################################
include(GoogleTest)
gtest_discover_tests(gtest_ctrl_pkt_opening)
gtest_discover_tests(gtest_ctrl_pkt_active)
gtest_discover_tests(gtest_data_pkt_stee_bypass)
gtest_discover_tests(gtest_data_pkt_stee_block)
gtest_discover_tests(gtest_data_pkt_stee_forward)
gtest_discover_tests(gtest_data_pkt_stee_rx_egress)
gtest_discover_tests(gtest_data_pkt_mirr_bypass)
gtest_discover_tests(gtest_data_pkt_mirr_block)
gtest_discover_tests(gtest_data_pkt_mirr_forward)
gtest_discover_tests(gtest_data_pkt_mirr_rx_drop)
gtest_discover_tests(gtest_data_pkt_error_bypass)
gtest_discover_tests(gtest_mix_pkt_stee_forward)
gtest_discover_tests(gtest_vlan_encapsulate)
file(COPY ./test_data/log/ DESTINATION ./log/)
file(COPY ./test_data/conf/ DESTINATION ./conf/)
file(COPY ./test_data/resource/ DESTINATION ./resource/)
file(COPY ${CMAKE_SOURCE_DIR}/resource/table_info.conf DESTINATION ./resource/)
|