1 /*
2 Copyright (c) 2021 Fraunhofer AISEC. See the COPYRIGHT
3 file at the top-level directory of this distribution.
4
5 Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 option. This file may not be copied, modified, or distributed
9 except according to those terms.
10 */
11
12 #include <zephyr.h>
13 #include <ztest.h>
14 #include "edhoc_testvector_tests/edhoc_tests.h"
15 #include "oscore_testvector_tests/oscore_tests.h"
16
test_initiator1(void)17 static void test_initiator1(void)
18 {
19 test_edhoc(INITIATOR, 1);
20 }
test_initiator2(void)21 static void test_initiator2(void)
22 {
23 test_edhoc(INITIATOR, 2);
24 }
test_initiator3(void)25 static void test_initiator3(void)
26 {
27 test_edhoc(INITIATOR, 3);
28 }
test_initiator4(void)29 static void test_initiator4(void)
30 {
31 test_edhoc(INITIATOR, 4);
32 }
test_initiator8(void)33 static void test_initiator8(void)
34 {
35 test_edhoc(INITIATOR, 8);
36 }
test_initiator9(void)37 static void test_initiator9(void)
38 {
39 test_edhoc(INITIATOR, 9);
40 }
test_initiator12(void)41 static void test_initiator12(void)
42 {
43 test_edhoc(INITIATOR, 12);
44 }
test_initiator13(void)45 static void test_initiator13(void)
46 {
47 test_edhoc(INITIATOR, 13);
48 }
49 // static void test_initiator14(void)
50 // {
51 // test_edhoc(INITIATOR, 14);
52 // }
53 // static void test_initiator15(void)
54 // {
55 // test_edhoc(INITIATOR, 15);
56 // }
57 // static void test_initiator16(void)
58 // {
59 // test_edhoc(INITIATOR, 16);
60 // }
61 // static void test_initiator17(void)
62 // {
63 // test_edhoc(INITIATOR, 17);
64 // }
65 /********************************/
test_responder1(void)66 static void test_responder1(void)
67 {
68 test_edhoc(RESPONDER, 1);
69 }
test_responder2(void)70 static void test_responder2(void)
71 {
72 test_edhoc(RESPONDER, 2);
73 }
test_responder3(void)74 static void test_responder3(void)
75 {
76 test_edhoc(RESPONDER, 3);
77 }
test_responder4(void)78 static void test_responder4(void)
79 {
80 test_edhoc(RESPONDER, 4);
81 }
test_responder8(void)82 static void test_responder8(void)
83 {
84 test_edhoc(RESPONDER, 8);
85 }
test_responder9(void)86 static void test_responder9(void)
87 {
88 test_edhoc(RESPONDER, 9);
89 }
test_responder12(void)90 static void test_responder12(void)
91 {
92 test_edhoc(RESPONDER, 12);
93 }
test_responder13(void)94 static void test_responder13(void)
95 {
96 test_edhoc(RESPONDER, 13);
97 }
98 // static void test_responder14(void)
99 // {
100 // test_edhoc(RESPONDER, 14);
101 // }
102 // static void test_responder15(void)
103 // {
104 // test_edhoc(RESPONDER, 15);
105 // }
106 // static void test_responder16(void)
107 // {
108 // test_edhoc(RESPONDER, 16);
109 // }
110 // static void test_responder17(void)
111 // {
112 // test_edhoc(RESPONDER, 17);
113 // }
114
test_main(void)115 void test_main(void)
116 {
117 /* EDHOC testvector tests */
118
119 ztest_test_suite(initiator_tests, ztest_unit_test(test_initiator1),
120 ztest_unit_test(test_initiator2),
121 ztest_unit_test(test_initiator3),
122 ztest_unit_test(test_initiator4),
123 //ztest_unit_test(test_initiator8),
124 //ztest_unit_test(test_initiator9), for 8 and 9 suites_i should be provided in raw form!
125 ztest_unit_test(test_initiator12),
126 ztest_unit_test(test_initiator13));
127 // ztest_unit_test(test_initiator14),
128 // ztest_unit_test(test_initiator15),
129 // ztest_unit_test(test_initiator16),
130 // ztest_unit_test(test_initiator17));
131
132 // ztest_test_suite(initiator_tests, ztest_unit_test(test_initiator1));
133
134 ztest_test_suite(responder_tests, ztest_unit_test(test_responder1),
135 ztest_unit_test(test_responder2),
136 ztest_unit_test(test_responder3),
137 ztest_unit_test(test_responder4),
138 ztest_unit_test(test_responder8),
139 ztest_unit_test(test_responder9),
140 ztest_unit_test(test_responder12),
141 ztest_unit_test(test_responder13));
142 // ztest_unit_test(test_responder14),
143 // ztest_unit_test(test_responder15),
144 // ztest_unit_test(test_responder16),
145 // ztest_unit_test(test_responder17));
146
147 //ztest_test_suite(responder_tests, ztest_unit_test(test_responder8));
148
149 ztest_run_test_suite(initiator_tests);
150 ztest_run_test_suite(responder_tests);
151
152 /* OSCORE testvector tests */
153
154 ztest_test_suite(oscore_tests, ztest_unit_test(oscore_client_test1),
155 ztest_unit_test(oscore_server_test2),
156 ztest_unit_test(oscore_client_test3),
157 ztest_unit_test(oscore_server_test4),
158 ztest_unit_test(oscore_client_test5),
159 ztest_unit_test(oscore_server_test6),
160 //test7 - not supported yet
161 ztest_unit_test(oscore_misc_test8));
162
163 // ztest_test_suite(oscore_tests, ztest_unit_test(oscore_client_test1),
164 // ztest_unit_test(oscore_server_test2));
165
166 ztest_run_test_suite(oscore_tests);
167 }
168