Skip to content

Commit 90a7ed0

Browse files
committed
Updating test fixture for latest CACE APIs
1 parent 3104e11 commit 90a7ed0

File tree

3 files changed

+139
-124
lines changed

3 files changed

+139
-124
lines changed

src/camp/generators/data/agent.c.jinja

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ int {{adm | c_func(suffix='init')}}(refda_agent_t *agent)
245245

246246
cace_amm_obj_ns_t *adm = cace_amm_obj_store_add_ns(
247247
&(agent->objs), cace_amm_idseg_ref_withenum({{adm.ns_org_name | c_str}}, {{adm.ns_org_enum | c_int}}),
248-
cace_amm_idseg_ref_withenum({{adm.ns_model_name | c_str}}, {{adm | cpp_enum}}), {{adm.latest_revision_date | c_str}});
248+
cace_amm_idseg_ref_withenum({{adm.ns_model_name | c_str}}, {{adm | cpp_enum}}), {{adm.latest_revision_date | c_str}});
249249
if (adm)
250250
{
251251
cace_amm_obj_desc_t *obj;

test/data/example-test.yang

+38-26
Original file line numberDiff line numberDiff line change
@@ -26,116 +26,128 @@ module example-test {
2626
reference
2727
"draft-ietf-dtn-adm-yang";
2828
}
29-
amm:enum 9999;
29+
3030
feature example {
3131
description
3232
"some feature";
3333
}
34+
35+
amm:enum 9999;
3436
amm:typedef counter32 {
3537
amm:enum 26;
38+
description
39+
"32-bit counter";
3640
amm:type "/ARITYPE/UINT";
3741
}
3842
amm:typedef gauge32 {
3943
amm:enum 27;
44+
description
45+
"32-bit gauge";
4046
amm:type "/ARITYPE/INT";
4147
}
4248
amm:typedef counter64 {
4349
amm:enum 28;
50+
description
51+
"64-bit counter";
4452
amm:type "/ARITYPE/UVAST";
4553
}
4654
amm:typedef gauge64 {
4755
amm:enum 29;
56+
description
57+
"64-bit gauge";
4858
amm:type "/ARITYPE/VAST";
4959
}
5060
amm:edd edd_uvast {
5161
amm:enum 0;
52-
amm:type "/ARITYPE/UVAST";
5362
description
5463
"Example UVAST EDD.";
64+
amm:type "/ARITYPE/UVAST";
5565
}
5666
amm:edd edd_uvast_param {
5767
amm:enum 1;
68+
description
69+
"Example UVAST EDD with parameters.";
5870
amm:type "/ARITYPE/UVAST";
5971
amm:parameter other {
60-
amm:type "/ARITYPE/UVAST";
6172
description
6273
"Example parameter.";
74+
amm:type "/ARITYPE/UVAST";
6375
}
64-
description
65-
"Example UVAST EDD with parameters.";
6676
}
6777
amm:edd edd_tp {
6878
amm:enum 2;
69-
amm:type "/ARITYPE/TP";
7079
description
7180
"Example TP EDD: current system time.";
81+
amm:type "/ARITYPE/TP";
7282
}
7383
amm:edd endpoint_active {
7484
amm:enum 3;
85+
description
86+
"Is the given endpoint active? (0=no)";
7587
amm:type "/ARITYPE/UVAST";
7688
amm:parameter endpoint_name {
77-
amm:type "/ARITYPE/TEXTSTR";
7889
description
7990
"Endpoint name.";
91+
amm:type "/ARITYPE/TEXTSTR";
8092
}
81-
description
82-
"Is the given endpoint active? (0=no)";
8393
}
8494
amm:var var_uvast_val {
8595
amm:enum 0;
86-
amm:type "/ARITYPE/UVAST";
87-
amm:init-value "34";
8896
description
8997
"Example UVAST VAR with initialized value.";
98+
amm:init-value "34";
99+
amm:type "/ARITYPE/UVAST";
90100
}
91101
amm:const const1 {
92-
amm:enum 0;
93102
if-feature "example";
94-
amm:type "/ARITYPE/UVAST";
95-
amm:init-value "31";
103+
amm:enum 0;
96104
description
97105
"Example value.";
106+
amm:init-value "31";
107+
amm:type "/ARITYPE/UVAST";
98108
}
99109
amm:const showall {
100110
amm:enum 1;
101-
amm:type "/ARITYPE/AC";
111+
description
112+
"Some constant list";
102113
amm:init-value "/AC/(./CONST/const1)";
114+
amm:type "/ARITYPE/AC";
103115
}
104116
amm:ctrl get {
105117
amm:enum 2;
118+
description
119+
"Get a single MIB value from the agent.";
106120
amm:parameter object {
107-
amm:type "/ARITYPE/OBJECT";
108-
amm:default "hello";
109121
description
110122
"Identity of the object to retrieve.";
123+
amm:default "hello";
124+
amm:type "/ARITYPE/OBJECT";
111125
}
112126
amm:result data {
113-
amm:type "/ARITYPE/BYTESTR";
114127
description
115128
"Encoded value of the object.";
129+
amm:type "/ARITYPE/BYTESTR";
116130
}
117-
description
118-
"Get a single MIB value from the agent.";
119131
}
120132
amm:ctrl set {
121133
amm:enum 3;
134+
description
135+
"Set a single MIB value in the agent.";
122136
amm:parameter object {
123-
amm:type "/ARITYPE/OBJECT";
124137
description
125138
"Identify the value to retrieve.";
139+
amm:type "/ARITYPE/OBJECT";
126140
}
127141
amm:parameter data {
128-
amm:type "/ARITYPE/BYTESTR";
129142
description
130143
"Endcoded value used to write the object";
144+
amm:type "/ARITYPE/BYTESTR";
131145
}
132146
amm:result errorcode {
133-
amm:type "/ARITYPE/BYTE";
134147
description
135148
"If non-zero, an indicator of an error.";
149+
amm:type "/ARITYPE/BYTE";
136150
}
137-
description
138-
"Set a single MIB value in the agent.";
139151
}
140152
amm:oper add {
141153
amm:enum 0;
@@ -159,4 +171,4 @@ module example-test {
159171
amm:type "/ARITYPE/UVAST";
160172
}
161173
}
162-
}
174+
}

0 commit comments

Comments
 (0)