Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 1 | /** |
Radek Krejci | 9e68d87 | 2016-09-15 14:50:48 +0200 | [diff] [blame] | 2 | * \file test_conformance.c |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 3 | * \author Radek Krejci <rkrejci@cesnet.cz> |
Radek Krejci | 9e68d87 | 2016-09-15 14:50:48 +0200 | [diff] [blame] | 4 | * \brief libyang tests - setting up modules as imported or implemented |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 5 | * |
| 6 | * Copyright (c) 2015 CESNET, z.s.p.o. |
| 7 | * |
| 8 | * This source code is licensed under BSD 3-Clause License (the "License"). |
| 9 | * You may not use this file except in compliance with the License. |
| 10 | * You may obtain a copy of the License at |
| 11 | * |
| 12 | * https://opensource.org/licenses/BSD-3-Clause |
| 13 | */ |
| 14 | |
| 15 | #include <errno.h> |
| 16 | #include <fcntl.h> |
| 17 | #include <pthread.h> |
| 18 | #include <setjmp.h> |
| 19 | #include <stdarg.h> |
| 20 | #include <stddef.h> |
| 21 | #include <stdlib.h> |
| 22 | #include <string.h> |
| 23 | #include <sys/stat.h> |
| 24 | #include <sys/types.h> |
| 25 | |
| 26 | #include <cmocka.h> |
| 27 | |
Jan Kundrát | fd7a5c7 | 2017-10-26 17:45:06 +0200 | [diff] [blame] | 28 | #include "libyang.h" |
Peter Feige | 8deb9a0 | 2018-06-19 05:29:42 +0000 | [diff] [blame] | 29 | #include <context.h> |
Jan Kundrát | fd7a5c7 | 2017-10-26 17:45:06 +0200 | [diff] [blame] | 30 | #include "tests/config.h" |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 31 | |
| 32 | #define SCHEMA_FOLDER_YIN TESTS_DIR"/schema/yin/conformance" |
| 33 | #define SCHEMA_FOLDER_YANG TESTS_DIR"/schema/yang/conformance" |
| 34 | |
| 35 | static int |
| 36 | setup_ctx(void **state) |
| 37 | { |
Radek Krejci | dd3263a | 2017-07-15 11:50:09 +0200 | [diff] [blame] | 38 | *state = ly_ctx_new(NULL, 0); |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 39 | if (!*state) { |
| 40 | return -1; |
| 41 | } |
| 42 | return 0; |
| 43 | } |
| 44 | |
| 45 | static int |
| 46 | teardown_ctx(void **state) |
| 47 | { |
| 48 | ly_ctx_destroy(*state, NULL); |
| 49 | return 0; |
| 50 | } |
| 51 | |
| 52 | static void |
| 53 | test_implemented1_yin(void **state) |
| 54 | { |
| 55 | struct ly_ctx *ctx = *state; |
| 56 | const struct lys_module *a, *b, *b2, *c, *c2; |
| 57 | |
| 58 | ly_ctx_set_searchdir(ctx, SCHEMA_FOLDER_YIN); |
| 59 | |
| 60 | /* loads a.yin (impl), b@2015-01-01.yin (impl by augment) and c@2015-03-03.yin (imp) */ |
| 61 | a = lys_parse_path(ctx, SCHEMA_FOLDER_YIN"/a.yin", LYS_IN_YIN); |
| 62 | assert_ptr_not_equal(a, NULL); |
| 63 | assert_int_equal(a->implemented, 1); |
| 64 | |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 65 | b = ly_ctx_get_module(ctx, "b", NULL, 1); |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 66 | assert_ptr_not_equal(b, NULL); |
| 67 | assert_int_equal(b->implemented, 1); |
| 68 | |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 69 | c = ly_ctx_get_module(ctx, "c", NULL, 0); |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 70 | assert_ptr_not_equal(c, NULL); |
| 71 | assert_int_equal(c->implemented, 0); |
| 72 | |
| 73 | /* another b cannot be loaded, since it is already implemented */ |
| 74 | b2 = lys_parse_path(ctx, SCHEMA_FOLDER_YIN"/b@2015-04-04.yin", LYS_IN_YIN); |
| 75 | assert_ptr_equal(b2, NULL); |
| 76 | assert_int_equal(ly_errno, LY_EINVAL); |
Michal Vasko | 53b7da0 | 2018-02-13 15:28:42 +0100 | [diff] [blame] | 77 | assert_string_equal(ly_errmsg(ctx), "Module \"b\" parsing failed."); |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 78 | |
| 79 | /* older c can be loaded and it will be marked as implemented */ |
| 80 | c2 = lys_parse_path(ctx, SCHEMA_FOLDER_YIN"/c@2015-01-01.yin", LYS_IN_YIN); |
| 81 | assert_ptr_not_equal(c2, NULL); |
| 82 | assert_int_equal(c2->implemented, 1); |
| 83 | assert_ptr_not_equal(c, c2); |
| 84 | } |
| 85 | |
| 86 | static void |
Pavol Vican | 5c186c2 | 2016-09-27 10:46:14 +0200 | [diff] [blame] | 87 | test_implemented1_yang(void **state) |
| 88 | { |
| 89 | struct ly_ctx *ctx = *state; |
| 90 | const struct lys_module *a, *b, *b2, *c, *c2; |
| 91 | |
| 92 | ly_ctx_set_searchdir(ctx, SCHEMA_FOLDER_YANG); |
| 93 | |
| 94 | /* loads a.yang (impl), b@2015-01-01.yang (impl by augment) and c@2015-03-03.yang (imp) */ |
| 95 | a = lys_parse_path(ctx, SCHEMA_FOLDER_YANG"/a.yang", LYS_IN_YANG); |
| 96 | assert_ptr_not_equal(a, NULL); |
| 97 | assert_int_equal(a->implemented, 1); |
| 98 | |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 99 | b = ly_ctx_get_module(ctx, "b", NULL, 1); |
Pavol Vican | 5c186c2 | 2016-09-27 10:46:14 +0200 | [diff] [blame] | 100 | assert_ptr_not_equal(b, NULL); |
| 101 | assert_int_equal(b->implemented, 1); |
| 102 | |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 103 | c = ly_ctx_get_module(ctx, "c", NULL, 0); |
Pavol Vican | 5c186c2 | 2016-09-27 10:46:14 +0200 | [diff] [blame] | 104 | assert_ptr_not_equal(c, NULL); |
| 105 | assert_int_equal(c->implemented, 0); |
| 106 | |
| 107 | /* another b cannot be loaded, since it is already implemented */ |
| 108 | b2 = lys_parse_path(ctx, SCHEMA_FOLDER_YANG"/b@2015-04-04.yang", LYS_IN_YANG); |
| 109 | assert_ptr_equal(b2, NULL); |
| 110 | assert_int_equal(ly_errno, LY_EINVAL); |
Michal Vasko | 53b7da0 | 2018-02-13 15:28:42 +0100 | [diff] [blame] | 111 | assert_string_equal(ly_errmsg(ctx), "Module \"b\" parsing failed."); |
Pavol Vican | 5c186c2 | 2016-09-27 10:46:14 +0200 | [diff] [blame] | 112 | |
| 113 | /* older c can be loaded and it will be marked as implemented */ |
| 114 | c2 = lys_parse_path(ctx, SCHEMA_FOLDER_YANG"/c@2015-01-01.yang", LYS_IN_YANG); |
| 115 | assert_ptr_not_equal(c2, NULL); |
| 116 | assert_int_equal(c2->implemented, 1); |
| 117 | assert_ptr_not_equal(c, c2); |
| 118 | } |
| 119 | |
| 120 | static void |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 121 | test_implemented2_yin(void **state) |
| 122 | { |
| 123 | struct ly_ctx *ctx = *state; |
Michal Vasko | a51f3ad | 2017-05-23 10:54:37 +0200 | [diff] [blame] | 124 | const struct lys_module *a, *b2; |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 125 | |
| 126 | ly_ctx_set_searchdir(ctx, SCHEMA_FOLDER_YIN); |
| 127 | |
| 128 | /* load the newest b first, it is implemented */ |
| 129 | b2 = ly_ctx_load_module(ctx, "b", "2015-04-04"); |
| 130 | assert_ptr_not_equal(b2, NULL); |
| 131 | assert_int_equal(b2->implemented, 1); |
| 132 | |
Michal Vasko | a51f3ad | 2017-05-23 10:54:37 +0200 | [diff] [blame] | 133 | /* loads a.yin (impl), b@2015-04-04 is augmented by a, but cannot be implemented */ |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 134 | a = lys_parse_path(ctx, SCHEMA_FOLDER_YIN"/a.yin", LYS_IN_YIN); |
Michal Vasko | a51f3ad | 2017-05-23 10:54:37 +0200 | [diff] [blame] | 135 | assert_ptr_equal(a, NULL); |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | static void |
Pavol Vican | 5c186c2 | 2016-09-27 10:46:14 +0200 | [diff] [blame] | 139 | test_implemented2_yang(void **state) |
| 140 | { |
| 141 | struct ly_ctx *ctx = *state; |
Michal Vasko | a51f3ad | 2017-05-23 10:54:37 +0200 | [diff] [blame] | 142 | const struct lys_module *a, *b2; |
Pavol Vican | 5c186c2 | 2016-09-27 10:46:14 +0200 | [diff] [blame] | 143 | |
| 144 | ly_ctx_set_searchdir(ctx, SCHEMA_FOLDER_YANG); |
| 145 | |
| 146 | /* load the newest b first, it is implemented */ |
| 147 | b2 = ly_ctx_load_module(ctx, "b", "2015-04-04"); |
| 148 | assert_ptr_not_equal(b2, NULL); |
| 149 | assert_int_equal(b2->implemented, 1); |
| 150 | |
Michal Vasko | a51f3ad | 2017-05-23 10:54:37 +0200 | [diff] [blame] | 151 | /* loads a.yin (impl), b@2015-04-04 is augmented by a, but cannot be implemented */ |
Pavol Vican | 5c186c2 | 2016-09-27 10:46:14 +0200 | [diff] [blame] | 152 | a = lys_parse_path(ctx, SCHEMA_FOLDER_YANG"/a.yang", LYS_IN_YANG); |
Michal Vasko | a51f3ad | 2017-05-23 10:54:37 +0200 | [diff] [blame] | 153 | assert_ptr_equal(a, NULL); |
Pavol Vican | 5c186c2 | 2016-09-27 10:46:14 +0200 | [diff] [blame] | 154 | } |
| 155 | |
| 156 | static void |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 157 | test_implemented_info_yin(void **state) |
| 158 | { |
| 159 | struct ly_ctx *ctx = *state; |
| 160 | struct lyd_node *info; |
| 161 | const struct lys_module *a; |
| 162 | char *data; |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 163 | const char *template = "<yang-library xmlns=\"urn:ietf:params:xml:ns:yang:ietf-yang-library\">\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 164 | " <module-set>\n" |
| 165 | " <name>complete</name>\n" |
| 166 | " <checksum>10</checksum>\n" |
| 167 | " <import-only-module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 168 | " <name>ietf-yang-metadata</name>\n" |
| 169 | " <revision>2016-08-05</revision>\n" |
| 170 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-yang-metadata</namespace>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 171 | " </import-only-module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 172 | " <module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 173 | " <name>yang</name>\n" |
| 174 | " <revision>2017-02-20</revision>\n" |
| 175 | " <namespace>urn:ietf:params:xml:ns:yang:1</namespace>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 176 | " </module>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 177 | " <import-only-module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 178 | " <name>ietf-inet-types</name>\n" |
| 179 | " <revision>2013-07-15</revision>\n" |
| 180 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-inet-types</namespace>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 181 | " </import-only-module>\n" |
| 182 | " <import-only-module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 183 | " <name>ietf-yang-types</name>\n" |
| 184 | " <revision>2013-07-15</revision>\n" |
| 185 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-yang-types</namespace>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 186 | " </import-only-module>\n" |
| 187 | " <import-only-module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 188 | " <name>ietf-datastores</name>\n" |
| 189 | " <revision>2017-08-17</revision>\n" |
| 190 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-datastores</namespace>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 191 | " </import-only-module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 192 | " <module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 193 | " <name>ietf-yang-library</name>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 194 | " <revision>2018-01-17</revision>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 195 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-yang-library</namespace>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 196 | " </module>\n" |
| 197 | " <module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 198 | " <name>b</name>\n" |
| 199 | " <revision>2015-01-01</revision>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 200 | " <namespace>urn:example:b</namespace>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 201 | " <location>file://"SCHEMA_FOLDER_YIN"/b@2015-01-01.yin</location>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 202 | " </module>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 203 | " <import-only-module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 204 | " <name>c</name>\n" |
| 205 | " <revision>2015-03-03</revision>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 206 | " <namespace>urn:example:c</namespace>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 207 | " <location>file://"SCHEMA_FOLDER_YIN"/c@2015-03-03.yin</location>\n" |
| 208 | " </import-only-module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 209 | " <module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 210 | " <name>a</name>\n" |
| 211 | " <revision>2015-01-01</revision>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 212 | " <namespace>urn:example:a</namespace>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 213 | " <location>file://"SCHEMA_FOLDER_YIN"/a.yin</location>\n" |
| 214 | " <feature>\n" |
| 215 | " <name>foo</name>\n" |
| 216 | " </feature>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 217 | " </module>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 218 | " </module-set>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 219 | " <checksum>10</checksum>\n" |
| 220 | "</yang-library>\n" |
| 221 | "<modules-state xmlns=\"urn:ietf:params:xml:ns:yang:ietf-yang-library\">\n" |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 222 | " <module>\n" |
Radek Krejci | 532e5e9 | 2017-02-22 12:59:24 +0100 | [diff] [blame] | 223 | " <name>ietf-yang-metadata</name>\n" |
| 224 | " <revision>2016-08-05</revision>\n" |
| 225 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-yang-metadata</namespace>\n" |
| 226 | " <conformance-type>import</conformance-type>\n" |
| 227 | " </module>\n" |
| 228 | " <module>\n" |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 229 | " <name>yang</name>\n" |
Radek Krejci | 532e5e9 | 2017-02-22 12:59:24 +0100 | [diff] [blame] | 230 | " <revision>2017-02-20</revision>\n" |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 231 | " <namespace>urn:ietf:params:xml:ns:yang:1</namespace>\n" |
| 232 | " <conformance-type>implement</conformance-type>\n" |
| 233 | " </module>\n" |
| 234 | " <module>\n" |
| 235 | " <name>ietf-inet-types</name>\n" |
| 236 | " <revision>2013-07-15</revision>\n" |
| 237 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-inet-types</namespace>\n" |
| 238 | " <conformance-type>import</conformance-type>\n" |
| 239 | " </module>\n" |
| 240 | " <module>\n" |
| 241 | " <name>ietf-yang-types</name>\n" |
| 242 | " <revision>2013-07-15</revision>\n" |
| 243 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-yang-types</namespace>\n" |
| 244 | " <conformance-type>import</conformance-type>\n" |
| 245 | " </module>\n" |
| 246 | " <module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 247 | " <name>ietf-datastores</name>\n" |
| 248 | " <revision>2017-08-17</revision>\n" |
| 249 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-datastores</namespace>\n" |
Radek Krejci | b39dfce | 2017-09-12 14:28:00 +0200 | [diff] [blame] | 250 | " <conformance-type>import</conformance-type>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 251 | " </module>\n" |
| 252 | " <module>\n" |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 253 | " <name>ietf-yang-library</name>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 254 | " <revision>2018-01-17</revision>\n" |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 255 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-yang-library</namespace>\n" |
| 256 | " <conformance-type>implement</conformance-type>\n" |
| 257 | " </module>\n" |
| 258 | " <module>\n" |
| 259 | " <name>b</name>\n" |
| 260 | " <revision>2015-01-01</revision>\n" |
| 261 | " <schema>file://"SCHEMA_FOLDER_YIN"/b@2015-01-01.yin</schema>\n" |
| 262 | " <namespace>urn:example:b</namespace>\n" |
| 263 | " <conformance-type>implement</conformance-type>\n" |
| 264 | " </module>\n" |
| 265 | " <module>\n" |
| 266 | " <name>c</name>\n" |
| 267 | " <revision>2015-03-03</revision>\n" |
| 268 | " <schema>file://"SCHEMA_FOLDER_YIN"/c@2015-03-03.yin</schema>\n" |
| 269 | " <namespace>urn:example:c</namespace>\n" |
| 270 | " <conformance-type>import</conformance-type>\n" |
| 271 | " </module>\n" |
| 272 | " <module>\n" |
| 273 | " <name>a</name>\n" |
| 274 | " <revision>2015-01-01</revision>\n" |
| 275 | " <schema>file://"SCHEMA_FOLDER_YIN"/a.yin</schema>\n" |
| 276 | " <namespace>urn:example:a</namespace>\n" |
| 277 | " <feature>foo</feature>\n" |
| 278 | " <conformance-type>implement</conformance-type>\n" |
| 279 | " </module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 280 | " <module-set-id>10</module-set-id>\n" |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 281 | "</modules-state>\n"; |
| 282 | |
| 283 | ly_ctx_set_searchdir(ctx, SCHEMA_FOLDER_YIN); |
| 284 | |
| 285 | /* loads a.yin (impl), b@2015-01-01.yin (impl by augment) and c@2015-03-03.yin (imp) */ |
| 286 | assert_ptr_not_equal((a = lys_parse_path(ctx, SCHEMA_FOLDER_YIN"/a.yin", LYS_IN_YIN)), NULL); |
| 287 | assert_int_equal(lys_features_enable(a, "foo"), 0); |
| 288 | |
| 289 | /* get yang-library data */ |
| 290 | info = ly_ctx_info(ctx); |
| 291 | assert_ptr_not_equal(info, NULL); |
| 292 | |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 293 | lyd_print_mem(&data, info, LYD_XML, LYP_FORMAT | LYP_WITHSIBLINGS); |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 294 | lyd_free_withsiblings(info); |
| 295 | assert_string_equal(data, template); |
| 296 | free(data); |
| 297 | } |
| 298 | |
Pavol Vican | 5c186c2 | 2016-09-27 10:46:14 +0200 | [diff] [blame] | 299 | static void |
| 300 | test_implemented_info_yang(void **state) |
| 301 | { |
| 302 | struct ly_ctx *ctx = *state; |
| 303 | struct lyd_node *info; |
| 304 | const struct lys_module *a; |
| 305 | char *data; |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 306 | const char *template = "<yang-library xmlns=\"urn:ietf:params:xml:ns:yang:ietf-yang-library\">\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 307 | " <module-set>\n" |
| 308 | " <name>complete</name>\n" |
| 309 | " <checksum>10</checksum>\n" |
| 310 | " <import-only-module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 311 | " <name>ietf-yang-metadata</name>\n" |
| 312 | " <revision>2016-08-05</revision>\n" |
| 313 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-yang-metadata</namespace>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 314 | " </import-only-module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 315 | " <module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 316 | " <name>yang</name>\n" |
| 317 | " <revision>2017-02-20</revision>\n" |
| 318 | " <namespace>urn:ietf:params:xml:ns:yang:1</namespace>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 319 | " </module>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 320 | " <import-only-module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 321 | " <name>ietf-inet-types</name>\n" |
| 322 | " <revision>2013-07-15</revision>\n" |
| 323 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-inet-types</namespace>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 324 | " </import-only-module>\n" |
| 325 | " <import-only-module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 326 | " <name>ietf-yang-types</name>\n" |
| 327 | " <revision>2013-07-15</revision>\n" |
| 328 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-yang-types</namespace>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 329 | " </import-only-module>\n" |
| 330 | " <import-only-module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 331 | " <name>ietf-datastores</name>\n" |
| 332 | " <revision>2017-08-17</revision>\n" |
| 333 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-datastores</namespace>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 334 | " </import-only-module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 335 | " <module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 336 | " <name>ietf-yang-library</name>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 337 | " <revision>2018-01-17</revision>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 338 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-yang-library</namespace>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 339 | " </module>\n" |
| 340 | " <module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 341 | " <name>b</name>\n" |
| 342 | " <revision>2015-01-01</revision>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 343 | " <namespace>urn:example:b</namespace>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 344 | " <location>file://"SCHEMA_FOLDER_YANG"/b@2015-01-01.yang</location>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 345 | " </module>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 346 | " <import-only-module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 347 | " <name>c</name>\n" |
| 348 | " <revision>2015-03-03</revision>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 349 | " <namespace>urn:example:c</namespace>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 350 | " <location>file://"SCHEMA_FOLDER_YANG"/c@2015-03-03.yang</location>\n" |
| 351 | " </import-only-module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 352 | " <module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 353 | " <name>a</name>\n" |
| 354 | " <revision>2015-01-01</revision>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 355 | " <namespace>urn:example:a</namespace>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 356 | " <location>file://"SCHEMA_FOLDER_YANG"/a.yang</location>\n" |
| 357 | " <feature>\n" |
| 358 | " <name>foo</name>\n" |
| 359 | " </feature>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 360 | " </module>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 361 | " </module-set>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 362 | " <checksum>10</checksum>\n" |
| 363 | "</yang-library>\n" |
| 364 | "<modules-state xmlns=\"urn:ietf:params:xml:ns:yang:ietf-yang-library\">\n" |
Pavol Vican | 5c186c2 | 2016-09-27 10:46:14 +0200 | [diff] [blame] | 365 | " <module>\n" |
Radek Krejci | 532e5e9 | 2017-02-22 12:59:24 +0100 | [diff] [blame] | 366 | " <name>ietf-yang-metadata</name>\n" |
| 367 | " <revision>2016-08-05</revision>\n" |
| 368 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-yang-metadata</namespace>\n" |
| 369 | " <conformance-type>import</conformance-type>\n" |
| 370 | " </module>\n" |
| 371 | " <module>\n" |
Pavol Vican | 5c186c2 | 2016-09-27 10:46:14 +0200 | [diff] [blame] | 372 | " <name>yang</name>\n" |
Radek Krejci | 532e5e9 | 2017-02-22 12:59:24 +0100 | [diff] [blame] | 373 | " <revision>2017-02-20</revision>\n" |
Pavol Vican | 5c186c2 | 2016-09-27 10:46:14 +0200 | [diff] [blame] | 374 | " <namespace>urn:ietf:params:xml:ns:yang:1</namespace>\n" |
| 375 | " <conformance-type>implement</conformance-type>\n" |
| 376 | " </module>\n" |
| 377 | " <module>\n" |
| 378 | " <name>ietf-inet-types</name>\n" |
| 379 | " <revision>2013-07-15</revision>\n" |
| 380 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-inet-types</namespace>\n" |
| 381 | " <conformance-type>import</conformance-type>\n" |
| 382 | " </module>\n" |
| 383 | " <module>\n" |
| 384 | " <name>ietf-yang-types</name>\n" |
| 385 | " <revision>2013-07-15</revision>\n" |
| 386 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-yang-types</namespace>\n" |
| 387 | " <conformance-type>import</conformance-type>\n" |
| 388 | " </module>\n" |
| 389 | " <module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 390 | " <name>ietf-datastores</name>\n" |
| 391 | " <revision>2017-08-17</revision>\n" |
| 392 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-datastores</namespace>\n" |
Radek Krejci | b39dfce | 2017-09-12 14:28:00 +0200 | [diff] [blame] | 393 | " <conformance-type>import</conformance-type>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 394 | " </module>\n" |
| 395 | " <module>\n" |
Pavol Vican | 5c186c2 | 2016-09-27 10:46:14 +0200 | [diff] [blame] | 396 | " <name>ietf-yang-library</name>\n" |
Michal Vasko | 7890116 | 2018-01-26 12:36:46 +0100 | [diff] [blame] | 397 | " <revision>2018-01-17</revision>\n" |
Pavol Vican | 5c186c2 | 2016-09-27 10:46:14 +0200 | [diff] [blame] | 398 | " <namespace>urn:ietf:params:xml:ns:yang:ietf-yang-library</namespace>\n" |
| 399 | " <conformance-type>implement</conformance-type>\n" |
| 400 | " </module>\n" |
| 401 | " <module>\n" |
| 402 | " <name>b</name>\n" |
| 403 | " <revision>2015-01-01</revision>\n" |
| 404 | " <schema>file://"SCHEMA_FOLDER_YANG"/b@2015-01-01.yang</schema>\n" |
| 405 | " <namespace>urn:example:b</namespace>\n" |
| 406 | " <conformance-type>implement</conformance-type>\n" |
| 407 | " </module>\n" |
| 408 | " <module>\n" |
| 409 | " <name>c</name>\n" |
| 410 | " <revision>2015-03-03</revision>\n" |
| 411 | " <schema>file://"SCHEMA_FOLDER_YANG"/c@2015-03-03.yang</schema>\n" |
| 412 | " <namespace>urn:example:c</namespace>\n" |
| 413 | " <conformance-type>import</conformance-type>\n" |
| 414 | " </module>\n" |
| 415 | " <module>\n" |
| 416 | " <name>a</name>\n" |
| 417 | " <revision>2015-01-01</revision>\n" |
| 418 | " <schema>file://"SCHEMA_FOLDER_YANG"/a.yang</schema>\n" |
| 419 | " <namespace>urn:example:a</namespace>\n" |
| 420 | " <feature>foo</feature>\n" |
| 421 | " <conformance-type>implement</conformance-type>\n" |
| 422 | " </module>\n" |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 423 | " <module-set-id>10</module-set-id>\n" |
Pavol Vican | 5c186c2 | 2016-09-27 10:46:14 +0200 | [diff] [blame] | 424 | "</modules-state>\n"; |
| 425 | |
| 426 | ly_ctx_set_searchdir(ctx, SCHEMA_FOLDER_YANG); |
| 427 | |
| 428 | /* loads a.yang (impl), b@2015-01-01.yang (impl by augment) and c@2015-03-03.yang (imp) */ |
| 429 | assert_ptr_not_equal((a = lys_parse_path(ctx, SCHEMA_FOLDER_YANG"/a.yang", LYS_IN_YANG)), NULL); |
| 430 | assert_int_equal(lys_features_enable(a, "foo"), 0); |
| 431 | |
| 432 | /* get yang-library data */ |
| 433 | info = ly_ctx_info(ctx); |
| 434 | assert_ptr_not_equal(info, NULL); |
| 435 | |
Radek Krejci | dfb00d6 | 2017-09-06 09:39:35 +0200 | [diff] [blame] | 436 | lyd_print_mem(&data, info, LYD_XML, LYP_FORMAT | LYP_WITHSIBLINGS); |
Pavol Vican | 5c186c2 | 2016-09-27 10:46:14 +0200 | [diff] [blame] | 437 | lyd_free_withsiblings(info); |
| 438 | assert_string_equal(data, template); |
| 439 | free(data); |
| 440 | } |
| 441 | |
Radek Krejci | 43c4983 | 2018-03-21 09:55:41 +0100 | [diff] [blame] | 442 | static void |
| 443 | test_revision_date_yin(void **state) |
| 444 | { |
| 445 | struct ly_ctx *ctx = *state; |
| 446 | const char *yin1 = "<module name=\"x\"" |
| 447 | "xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\"" |
| 448 | "xmlns:x=\"urn:cesnet:x\">" |
| 449 | "<namespace uri=\"urn:cesnet:x\"/>" |
| 450 | "<prefix value=\"x\"/>" |
| 451 | "<revision date=\"2018-02-29\"/>" |
| 452 | "</module>"; |
| 453 | const char *yin2 = "<module name=\"x\"" |
| 454 | "xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\"" |
| 455 | "xmlns:x=\"urn:cesnet:x\">" |
| 456 | "<namespace uri=\"urn:cesnet:x\"/>" |
| 457 | "<prefix value=\"x\"/>" |
| 458 | "<revision date=\"18-02-28\"/>" |
| 459 | "</module>"; |
| 460 | const char *yin3 = "<module name=\"x\"" |
| 461 | "xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\"" |
| 462 | "xmlns:x=\"urn:cesnet:x\">" |
| 463 | "<namespace uri=\"urn:cesnet:x\"/>" |
| 464 | "<prefix value=\"x\"/>" |
| 465 | "<revision date=\"today\"/>" |
| 466 | "</module>"; |
| 467 | const char *yin4 = "<module name=\"x\"" |
| 468 | "xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\"" |
| 469 | "xmlns:x=\"urn:cesnet:x\">" |
| 470 | "<namespace uri=\"urn:cesnet:x\"/>" |
| 471 | "<prefix value=\"x\"/>" |
| 472 | "<revision date=\"2018-02-28\"/>" |
| 473 | "</module>"; |
| 474 | const char *yin5 = "<module name=\"y\"" |
| 475 | "xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\"" |
| 476 | "xmlns:y=\"urn:cesnet:y\">" |
| 477 | "<namespace uri=\"urn:cesnet:y\"/>" |
| 478 | "<prefix value=\"y\"/>" |
| 479 | "<revision date=\"2016-02-29\"/>" |
| 480 | "</module>"; |
| 481 | const char *yin6 = "<module name=\"z\"" |
| 482 | "xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\"" |
| 483 | "xmlns:z=\"urn:cesnet:z\">" |
| 484 | "<namespace uri=\"urn:cesnet:z\"/>" |
| 485 | "<prefix value=\"z\"/>" |
| 486 | "<revision date=\"2000-02-29\"/>" |
| 487 | "</module>"; |
| 488 | |
| 489 | /* invalid dates */ |
| 490 | assert_ptr_equal(lys_parse_mem(ctx, yin1, LYS_IN_YIN), NULL); |
| 491 | assert_int_equal(ly_vecode(ctx), LYVE_INDATE); |
| 492 | |
| 493 | assert_ptr_equal(lys_parse_mem(ctx, yin2, LYS_IN_YIN), NULL); |
| 494 | assert_int_equal(ly_vecode(ctx), LYVE_INDATE); |
| 495 | |
| 496 | assert_ptr_equal(lys_parse_mem(ctx, yin3, LYS_IN_YIN), NULL); |
| 497 | assert_int_equal(ly_vecode(ctx), LYVE_INDATE); |
| 498 | |
| 499 | /* valid dates */ |
| 500 | assert_ptr_not_equal(lys_parse_mem(ctx, yin4, LYS_IN_YIN), NULL); |
| 501 | assert_ptr_not_equal(lys_parse_mem(ctx, yin5, LYS_IN_YIN), NULL); |
| 502 | assert_ptr_not_equal(lys_parse_mem(ctx, yin6, LYS_IN_YIN), NULL); |
| 503 | } |
| 504 | |
| 505 | static void |
| 506 | test_revision_date_yang(void **state) |
| 507 | { |
| 508 | struct ly_ctx *ctx = *state; |
| 509 | const char *yang1 = "module x {" |
| 510 | "namespace urn:cesnet:x;" |
| 511 | "prefix x;" |
| 512 | "revision \"2018-02-29\";}"; |
| 513 | const char *yang2 = "module x {" |
| 514 | "namespace urn:cesnet:x;" |
| 515 | "prefix x;" |
| 516 | "revision \"18-02-28\";}"; |
| 517 | const char *yang3 = "module x {" |
| 518 | "namespace urn:cesnet:x;" |
| 519 | "prefix x;" |
| 520 | "revision \"today\";}"; |
| 521 | const char *yang4 = "module x {" |
| 522 | "namespace urn:cesnet:x;" |
| 523 | "prefix x;" |
| 524 | "revision \"2018-02-28\";}"; |
| 525 | const char *yang5 = "module y {" |
| 526 | "namespace urn:cesnet:y;" |
| 527 | "prefix y;" |
| 528 | "revision \"2016-02-29\";}"; |
| 529 | const char *yang6 = "module z {" |
| 530 | "namespace urn:cesnet:z;" |
| 531 | "prefix z;" |
| 532 | "revision \"2000-02-29\";}"; |
| 533 | |
| 534 | /* invalid dates */ |
| 535 | assert_ptr_equal(lys_parse_mem(ctx, yang1, LYS_IN_YANG), NULL); |
| 536 | assert_int_equal(ly_vecode(ctx), LYVE_INDATE); |
| 537 | |
| 538 | assert_ptr_equal(lys_parse_mem(ctx, yang2, LYS_IN_YANG), NULL); |
| 539 | assert_int_equal(ly_vecode(ctx), LYVE_INDATE); |
| 540 | |
| 541 | assert_ptr_equal(lys_parse_mem(ctx, yang3, LYS_IN_YANG), NULL); |
| 542 | assert_int_equal(ly_vecode(ctx), LYVE_INDATE); |
| 543 | |
| 544 | /* valid dates */ |
| 545 | assert_ptr_not_equal(lys_parse_mem(ctx, yang4, LYS_IN_YANG), NULL); |
| 546 | assert_ptr_not_equal(lys_parse_mem(ctx, yang5, LYS_IN_YANG), NULL); |
| 547 | assert_ptr_not_equal(lys_parse_mem(ctx, yang6, LYS_IN_YANG), NULL); |
| 548 | } |
| 549 | |
Peter Feige | 8deb9a0 | 2018-06-19 05:29:42 +0000 | [diff] [blame] | 550 | |
| 551 | const struct lys_module * |
| 552 | _my_data_clb(struct ly_ctx *ctx, const char *name, const char *ns, int options, void *user_data) |
| 553 | { |
| 554 | char filepath[256] = {0}; |
| 555 | const struct lys_module *ly_module = NULL; |
| 556 | |
| 557 | fprintf(stderr, "%s:%i %s() name:%s ns:%s \n", __FILE__, __LINE__, __FUNCTION__, name, ns); |
| 558 | |
| 559 | snprintf(filepath, sizeof(filepath), "%s/%s.yang", SCHEMA_FOLDER_YANG, name); |
| 560 | ly_module = lys_parse_path(ctx, filepath, LYS_IN_YANG); |
| 561 | if ( !ly_module ) { |
| 562 | fprintf(stderr, "%s:%i %s() lys_parse_path(%s) failed (%d %p)\n", __FILE__, __LINE__, __FUNCTION__, filepath, options, user_data); |
| 563 | } |
| 564 | |
| 565 | return ly_module; |
| 566 | } |
| 567 | |
| 568 | static void |
| 569 | test_issue_already_implemented(void **state) { |
| 570 | struct ly_ctx *ctx = *state; |
| 571 | const struct lys_module *a = NULL; |
| 572 | char* search_paths[] = {SCHEMA_FOLDER_YANG, NULL}; |
| 573 | |
| 574 | ctx->models.search_paths = search_paths; |
| 575 | ctx->data_clb = _my_data_clb; |
| 576 | |
| 577 | a = lys_parse_path(ctx, SCHEMA_FOLDER_YANG "/ident-aug-must-issue-apst.yang", LYS_IN_YANG); |
| 578 | |
| 579 | ctx->data_clb = NULL; |
| 580 | ctx->models.search_paths = NULL; |
| 581 | |
| 582 | assert_ptr_not_equal(a, NULL); |
| 583 | |
| 584 | } |
| 585 | |
| 586 | |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 587 | int |
| 588 | main(void) |
| 589 | { |
| 590 | const struct CMUnitTest cmut[] = { |
| 591 | cmocka_unit_test_setup_teardown(test_implemented1_yin, setup_ctx, teardown_ctx), |
Pavol Vican | 5c186c2 | 2016-09-27 10:46:14 +0200 | [diff] [blame] | 592 | cmocka_unit_test_setup_teardown(test_implemented1_yang, setup_ctx, teardown_ctx), |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 593 | cmocka_unit_test_setup_teardown(test_implemented2_yin, setup_ctx, teardown_ctx), |
Pavol Vican | 5c186c2 | 2016-09-27 10:46:14 +0200 | [diff] [blame] | 594 | cmocka_unit_test_setup_teardown(test_implemented2_yang, setup_ctx, teardown_ctx), |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 595 | cmocka_unit_test_setup_teardown(test_implemented_info_yin, setup_ctx, teardown_ctx), |
Pavol Vican | 5c186c2 | 2016-09-27 10:46:14 +0200 | [diff] [blame] | 596 | cmocka_unit_test_setup_teardown(test_implemented_info_yang, setup_ctx, teardown_ctx), |
Radek Krejci | 43c4983 | 2018-03-21 09:55:41 +0100 | [diff] [blame] | 597 | cmocka_unit_test_setup_teardown(test_revision_date_yin, setup_ctx, teardown_ctx), |
| 598 | cmocka_unit_test_setup_teardown(test_revision_date_yang, setup_ctx, teardown_ctx), |
Peter Feige | 8deb9a0 | 2018-06-19 05:29:42 +0000 | [diff] [blame] | 599 | cmocka_unit_test_setup_teardown(test_issue_already_implemented, setup_ctx, teardown_ctx) |
Radek Krejci | 1a4a1c8 | 2016-09-14 16:07:25 +0200 | [diff] [blame] | 600 | }; |
| 601 | |
| 602 | return cmocka_run_group_tests(cmut, NULL, NULL); |
| 603 | } |