1%%
2%% %CopyrightBegin%
3%%
4%% Copyright Ericsson AB 2003-2020. All Rights Reserved.
5%%
6%% Licensed under the Apache License, Version 2.0 (the "License");
7%% you may not use this file except in compliance with the License.
8%% You may obtain a copy of the License at
9%%
10%%     http://www.apache.org/licenses/LICENSE-2.0
11%%
12%% Unless required by applicable law or agreed to in writing, software
13%% distributed under the License is distributed on an "AS IS" BASIS,
14%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15%% See the License for the specific language governing permissions and
16%% limitations under the License.
17%%
18%% %CopyrightEnd%
19%%
20
21%%
22%%----------------------------------------------------------------------
23%% Purpose:
24%%----------------------------------------------------------------------
25-module(snmp_conf_SUITE).
26
27%%----------------------------------------------------------------------
28%% Include files
29%%----------------------------------------------------------------------
30
31-include_lib("common_test/include/ct.hrl").
32-include("snmp_test_lib.hrl").
33
34-include_lib("snmp/include/STANDARD-MIB.hrl").
35-include_lib("snmp/include/OTP-SNMPEA-MIB.hrl").
36
37
38%%----------------------------------------------------------------------
39%% External exports
40%%----------------------------------------------------------------------
41-export([
42         suite/0, all/0, groups/0,
43         init_per_suite/1,    end_per_suite/1,
44         init_per_group/2,    end_per_group/2,
45         init_per_testcase/2, end_per_testcase/2,
46
47	 check_mandatory/1,
48	 check_integer1/1,
49	 check_integer2/1,
50	 check_string1/1,
51	 check_string2/1,
52	 check_atom/1,
53	 check_ip/1,
54	 check_taddress/1,
55	 check_packet_size/1,
56	 check_oid/1,
57	 check_sec_model1/1,
58	 check_sec_model2/1,
59	 check_sec_level/1,
60	 check_timer/1,
61
62	 read/1,
63	 read_files/1
64	]).
65
66
67%%======================================================================
68%% Common Test interface functions
69%%======================================================================
70
71suite() ->
72    [{ct_hooks, [ts_install_cth]}].
73
74all() ->
75    [
76     check_mandatory,
77     check_integer1, check_integer2,
78     check_string1, check_string2,
79     check_atom,
80     check_ip,
81     check_taddress,
82     check_packet_size,
83     check_oid,
84     check_sec_model1,
85     check_sec_model2,
86     check_sec_level,
87     check_timer,
88     read, read_files
89    ].
90
91groups() ->
92    [].
93
94
95
96%%
97%% -----
98%%
99
100init_per_suite(Config0) when is_list(Config0) ->
101    ?IPRINT("init_per_suite -> entry with"
102            "~n      Config0: ~p", [Config0]),
103
104    case ?LIB:init_per_suite(Config0) of
105        {skip, _} = SKIP ->
106            SKIP;
107
108        Config1 when is_list(Config1) ->
109            %% We need a monitor on this node also
110            snmp_test_sys_monitor:start(),
111
112            ?IPRINT("init_per_suite -> end when"
113                    "~n      Config: ~p", [Config1]),
114
115            Config1
116    end.
117
118end_per_suite(Config0) when is_list(Config0) ->
119    ?IPRINT("end_per_suite -> entry with"
120            "~n      Config0: ~p", [Config0]),
121
122    snmp_test_sys_monitor:stop(),
123    Config1 = ?LIB:end_per_suite(Config0),
124
125    ?IPRINT("end_per_suite -> end"),
126
127    Config1.
128
129
130
131%%
132%% -----
133%%
134
135init_per_group(_GroupName, Config) ->
136	Config.
137
138end_per_group(_GroupName, Config) ->
139	Config.
140
141
142
143%%
144%% -----
145%%
146
147init_per_testcase(_Case, Config) when is_list(Config) ->
148    Config.
149
150end_per_testcase(_Case, Config) when is_list(Config) ->
151    Config.
152
153
154
155%%======================================================================
156%% Test functions
157%%======================================================================
158
159check_mandatory(suite) -> [];
160check_mandatory(Config) when is_list(Config) ->
161    ?P(check_mandatory),
162    %% ?IPRINT("check_mandatory -> entry"),
163    A1 = [{a, hej}, {b, hopp}, {c, 10}, {d, 10101}, {f, 10.88}],
164    B1 = [{a, {value, hejsan}},
165	  {b, mandatory},
166	  {d, {value, 20202}},
167	  {e, {value, "kalle"}}],
168    ?line {ok, _L1} = verify_mandatory(A1, B1),
169    ?DBG("check_mandatory -> L1: ~p", [L1]),
170    A2 = [{a, hej}, {c, 10}, {d, 10101}, {f, 10.88}],
171    B2 = [{a, {value, hejsan}},
172	  {b, mandatory},
173	  {d, {value, 20202}},
174	  {e, {value, "kalle"}}],
175    ?line ok = verify_not_mandatory(A2, B2),
176    ok.
177
178verify_mandatory(A, B) ->
179    case (catch snmp_conf:check_mandatory(A, B)) of
180	{'EXIT', Reason} ->
181	    ?FAIL({mandatory_fail, A, B, Reason});
182	{ok, A} ->
183	    ?FAIL({mandatory_not_updated, A, B});
184	{ok, L} when A /= L ->
185	    verify_mandatory2(B, L)
186    end.
187
188verify_mandatory2([], L) ->
189    {ok, L};
190verify_mandatory2([{Key, _}|T], L) ->
191    case lists:keysearch(Key, 1, L) of
192	false ->
193	    ?FAIL({missing_key, Key, L});
194	{value, _} ->
195	    verify_mandatory2(T, L)
196    end.
197
198verify_not_mandatory(A, B) ->
199    case (catch snmp_conf:check_mandatory(A, B)) of
200	{error, _Reason} ->
201	    ok;
202	Else ->
203	    ?FAIL({mandatory_not_fail, Else})
204    end.
205
206
207%%======================================================================
208
209check_integer1(suite) -> [];
210check_integer1(Config) when is_list(Config) ->
211    ?P(check_integer1),
212    ?line ok = verify_int(0),
213    ?line ok = verify_int(16#FF),
214    ?line ok = verify_int(16#FFFF),
215    ?line ok = verify_int(16#FFFFFFFF),
216    ?line ok = verify_int(-1),
217    ?line ok = verify_int(-333),
218
219    ?line ok = verify_not_int("kalle & hobbe"),
220    ?line ok = verify_not_int(kalle_och_hobbe),
221    ?line ok = verify_not_int(1.5),
222
223    ok.
224
225verify_int(Val) ->
226    case (catch snmp_conf:check_integer(Val)) of
227	{error, Reason} ->
228	    ?FAIL({verify_int, Val, Reason});
229	ok ->
230	    ok
231    end.
232
233verify_not_int(Val) ->
234    case (catch snmp_conf:check_integer(Val)) of
235	ok ->
236	    ?FAIL({verify_int, Val});
237	{error, _Reason} ->
238	    ok
239    end.
240
241%%======================================================================
242
243check_integer2(suite) -> [];
244check_integer2(Config) when is_list(Config) ->
245    ?P(check_integer2),
246
247    ?line ok = verify_int(0,      any),
248    ?line ok = verify_int(-22222, any),
249    ?line ok = verify_int(33333,  any),
250    ?line ok = verify_int(1,      pos),
251    ?line ok = verify_int(9999,   pos),
252    ?line ok = verify_int(-1,     neg),
253    ?line ok = verify_int(-9999,  neg),
254    ?line ok = verify_int(1,      {gt, 0}),
255    ?line ok = verify_int(88888,  {gt, -255}),
256    ?line ok = verify_int(88888,  {gte, -255}),
257    ?line ok = verify_int(88888,  {gte, 88888}),
258    ?line ok = verify_int(88888,  {lt,  88889}),
259    ?line ok = verify_int(88888,  {lte, 88888}),
260    ?line ok = verify_int(88888,  {eq,  88888}),
261    ?line ok = verify_int(88888,  {range, 88887,88889}),
262
263    ?line ok = verify_not_int("kalle & hobbe", any),
264    ?line ok = verify_not_int(kalle_och_hobbe, any),
265    ?line ok = verify_not_int(1.5,             any),
266
267    ?line ok = verify_not_int(0,      pos),
268    ?line ok = verify_not_int(-22222, pos),
269    ?line ok = verify_not_int(33333,  neg),
270    ?line ok = verify_not_int(0,      {gt,  0}),
271    ?line ok = verify_not_int(33333,  {gt,  99999}),
272    ?line ok = verify_not_int(33333,  {gt,  33333}),
273    ?line ok = verify_not_int(33333,  {gte, 33334}),
274    ?line ok = verify_not_int(33333,  {lt,  33333}),
275    ?line ok = verify_not_int(33333,  {lte, 33332}),
276    ?line ok = verify_not_int(33333,  {eq,  33332}),
277    ?line ok = verify_not_int(33333,  {eq,  -33333}),
278    ?line ok = verify_not_int(33333,  {range, 33334, 33338}),
279    ?line ok = verify_not_int(33339,  {range, 33334, 33338}),
280    ?line ok = verify_not_int(33333,  {gt,  kalle}),
281    ?line ok = verify_not_int(33333,  {gt,  1.55}),
282    ?line ok = verify_not_int(33333,  {gte, "hejsan"}),
283    ?line ok = verify_not_int(33333,  {lt,  hobbe}),
284    ?line ok = verify_not_int(33333,  {lte, 1.7666}),
285    ?line ok = verify_not_int(33333,  {eq,  33333.0}),
286    ?line ok = verify_not_int(33333,  {eq,  -33333.0}),
287    ?line ok = verify_not_int(33333,  {range, kalle, 33338}),
288    ?line ok = verify_not_int(33339,  {range, 33334, kalle}),
289    ?line ok = verify_not_int(33339,  {kalle, 33334, kalle}),
290
291    ok.
292
293verify_int(Val, Cond) ->
294    case (catch snmp_conf:check_integer(Val, Cond)) of
295	{error, Reason} ->
296	    ?FAIL({verify_int, Val, Cond, Reason});
297	ok ->
298	    ok
299    end.
300
301verify_not_int(Val, Cond) ->
302    case (catch snmp_conf:check_integer(Val, Cond)) of
303	ok ->
304	    ?FAIL({verify_int, Val, Cond});
305	{error, _Reason} ->
306	    ok
307    end.
308
309%%======================================================================
310
311check_string1(suite) -> [];
312check_string1(Config) when is_list(Config) ->
313    ?P(check_string1),
314    ?line ok = verify_string("kalle & hobbe"),
315    ?line ok = verify_not_string(kalle_hobbe),
316    ?line ok = verify_not_string(1000),
317    ?line ok = verify_not_string(1.0),
318    ok.
319
320verify_string(Val) ->
321    case (catch snmp_conf:check_string(Val)) of
322	{error, Reason} ->
323	    ?FAIL({verify_string, Val, Reason});
324	ok ->
325	    ok
326    end.
327
328verify_not_string(Val) ->
329    case (catch snmp_conf:check_string(Val)) of
330	ok ->
331	    ?FAIL({verify_string, Val});
332	{error, _Reason} ->
333	    ok
334    end.
335
336
337%%======================================================================
338
339check_string2(suite) -> [];
340check_string2(Config) when is_list(Config) ->
341    ?P(check_string2),
342    Str = "kalle & hobbe",
343    ?line ok = verify_string(Str, any),
344    ?line ok = verify_string(Str, {gt,  length(Str) - 1}),
345    ?line ok = verify_string(Str, {gte, length(Str)}),
346    ?line ok = verify_string(Str, {lt,  length(Str) + 1}),
347    ?line ok = verify_string(Str, {lte, length(Str)}),
348    ?line ok = verify_string(Str, length(Str)),
349
350    ?line ok = verify_not_string(kalle_hobbe, any),
351    ?line ok = verify_not_string(1000, any),
352    ?line ok = verify_not_string(1.0, any),
353    ?line ok = verify_not_string(Str, {gt,  length(Str)}),
354    ?line ok = verify_not_string(Str, {gte, length(Str) + 1}),
355    ?line ok = verify_not_string(Str, {lt,  length(Str)}),
356    ?line ok = verify_not_string(Str, {lte, length(Str) - 1}),
357    ?line ok = verify_not_string(Str, length(Str) + 1),
358    ok.
359
360verify_string(Val, Limit) ->
361    case (catch snmp_conf:check_string(Val, Limit)) of
362	{error, Reason} ->
363	    ?FAIL({verify_string, Val, Limit, Reason});
364	ok ->
365	    ok
366    end.
367
368verify_not_string(Val, Limit) ->
369    case (catch snmp_conf:check_string(Val, Limit)) of
370	ok ->
371	    ?FAIL({verify_string, Val, Limit});
372	{error, _Reason} ->
373	    ok
374    end.
375
376
377%%======================================================================
378
379check_atom(suite) -> [];
380check_atom(Config) when is_list(Config) ->
381    ?P(check_atom),
382    Atoms = [{kalle, "kalle"}, {hobbe, "hobbe"}, {dummy, "dummy"}],
383    ?line ok = verify_atom(kalle, Atoms),
384    ?line ok = verify_not_atom(anka, Atoms),
385    ?line ok = verify_not_atom("kalle", Atoms),
386    ?line ok = verify_not_atom(1000, Atoms),
387    ok.
388
389verify_atom(Val, Atoms) ->
390    case (catch snmp_conf:check_atom(Val, Atoms)) of
391	{error, Reason} ->
392	    ?FAIL({verify_atom, Val, Atoms, Reason});
393	{ok, _} ->
394	    ok
395    end.
396
397verify_not_atom(Val, Atoms) ->
398    case (catch snmp_conf:check_atom(Val, Atoms)) of
399	ok ->
400	    ?FAIL({verify_atom, Val, Atoms});
401	{error, _Reason} ->
402	    ok
403    end.
404
405
406%%======================================================================
407
408check_ip(suite) -> [];
409check_ip(Config) when is_list(Config) ->
410    ?P(check_ip),
411    ?line ok = verify_ip([1,2,3,4]),
412    ?line ok = verify_not_ip([1,2,3]),
413    ?line ok = verify_not_ip([1,2,3,4,5]),
414    ?line ok = verify_not_ip(kalle),
415    ?line ok = verify_not_ip(1000),
416    ?line ok = verify_not_ip([1,2,3.0,4]),
417    ?line ok = verify_not_ip([1,two,3,4]),
418    ok.
419
420verify_ip(Val) ->
421    case (catch snmp_conf:check_ip(Val)) of
422	{error, Reason} ->
423	    ?FAIL({verify_ip, Val, Reason});
424	{ok, _} ->
425	    ok;
426	ok ->
427	    ok
428    end.
429
430verify_not_ip(Val) ->
431    case (catch snmp_conf:check_ip(Val)) of
432	ok ->
433	    ?FAIL({verify_ip, Val});
434	{error, _Reason} ->
435	    ok
436    end.
437
438
439%%======================================================================
440
441check_taddress(suite) -> [];
442check_taddress(Config) when is_list(Config) ->
443    ?P(check_taddress),
444    ?line ok = verify_taddress([1,2,3,4,5,6]),
445    ?line ok = verify_not_taddress([1,2,3,4,5]),
446    ?line ok = verify_not_taddress([1,2,3,4,5,6,7]),
447    ?line ok = verify_not_taddress(kalle),
448    ?line ok = verify_not_taddress(1000),
449    ?line ok = verify_not_taddress([1,2,3.0,4,5,6]),
450    ?line ok = verify_not_taddress([1,two,3,4,5,6]),
451    ok.
452
453verify_taddress(Val) ->
454    case (catch snmp_conf:check_taddress(snmpUDPDomain, Val)) of
455	{error, Reason} ->
456	    ?FAIL({verify_taddress, Val, Reason});
457	ok ->
458	    ok
459    end.
460
461verify_not_taddress(Val) ->
462    case (catch snmp_conf:check_taddress(snmpUDPDomain, Val)) of
463	ok ->
464	    ?FAIL({verify_taddress, Val});
465	{error, _Reason} ->
466	    ok
467    end.
468
469
470%%======================================================================
471
472check_packet_size(suite) -> [];
473check_packet_size(Config) when is_list(Config) ->
474    ?P(check_packet_size),
475    Min = 484,
476    Max = 2147483647,
477    ?line ok = verify_packet_size(Min),
478    ?line ok = verify_packet_size(2*Min),
479    ?line ok = verify_packet_size(Max),
480    ?line ok = verify_not_packet_size(Min-1),
481    ?line ok = verify_not_packet_size(Max+1),
482    ?line ok = verify_not_packet_size(kalle),
483    ?line ok = verify_not_packet_size("kalle"),
484    ?line ok = verify_not_packet_size(1.0),
485    ?line ok = verify_not_packet_size(1.0*Max),
486    ok.
487
488verify_packet_size(Val) ->
489    case (catch snmp_conf:check_packet_size(Val)) of
490	{error, Reason} ->
491	    ?FAIL({verify_packet_size, Val, Reason});
492	ok ->
493	    ok
494    end.
495
496verify_not_packet_size(Val) ->
497    case (catch snmp_conf:check_packet_size(Val)) of
498	ok ->
499	    ?FAIL({verify_packet_size, Val});
500	{error, _Reason} ->
501	    ok
502    end.
503
504
505%%======================================================================
506
507check_oid(suite) -> [];
508check_oid(Config) when is_list(Config) ->
509    ?P(check_oid),
510    [_,_|Rest] = ?otpSnmpeaModule,
511    ErrOid = [6,16|Rest],
512    ?line ok = verify_oid(?system),
513    ?line ok = verify_oid(?sysDescr_instance),
514    ?line ok = verify_oid(?otpSnmpeaModule),
515    ?line ok = verify_not_oid(kalle),
516    ?line ok = verify_not_oid("kalle"),
517    ?line ok = verify_not_oid(1000),
518    ?line ok = verify_not_oid(1.0),
519    ?line ok = verify_not_oid(ErrOid),
520    ok.
521
522verify_oid(Val) ->
523    case (catch snmp_conf:check_oid(Val)) of
524	{error, Reason} ->
525	    ?FAIL({verify_oid, Val, Reason});
526	ok ->
527	    ok
528    end.
529
530verify_not_oid(Val) ->
531    case (catch snmp_conf:check_oid(Val)) of
532	ok ->
533	    ?FAIL({verify_oid, Val});
534	{error, _Reason} ->
535	    ok
536    end.
537
538
539%%======================================================================
540
541check_sec_model1(suite) -> [];
542check_sec_model1(Config) when is_list(Config) ->
543    ?P(check_sec_model1),
544    Exclude1 = [],
545    Exclude2 = [v1],
546    Exclude3 = [v1,usm],
547    ?line ok = verify_sec_model(any, Exclude1),
548    ?line ok = verify_sec_model(v1,  Exclude1),
549    ?line ok = verify_sec_model(v2c, Exclude1),
550    ?line ok = verify_sec_model(usm, Exclude1),
551    ?line ok = verify_sec_model(any, Exclude2),
552    ?line ok = verify_sec_model(v2c, Exclude2),
553    ?line ok = verify_not_sec_model(v1, Exclude2),
554    ?line ok = verify_not_sec_model(v1, Exclude3),
555    ?line ok = verify_not_sec_model(usm, Exclude3),
556    ok.
557
558verify_sec_model(Val, Exclude) ->
559    case (catch snmp_conf:check_sec_model(Val, Exclude)) of
560	{error, Reason} ->
561	    ?FAIL({verify_sec_model, Val, Reason});
562	{ok, _} ->
563	    ok
564    end.
565
566verify_not_sec_model(Val, Exclude) ->
567    case (catch snmp_conf:check_sec_model(Val, Exclude)) of
568	{ok, Res} ->
569	    ?FAIL({verify_sec_model, Val, Res});
570	{error, _Reason} ->
571	    ok
572    end.
573
574
575%%======================================================================
576
577check_sec_model2(suite) -> [];
578check_sec_model2(Config) when is_list(Config) ->
579    ?P(check_sec_model2),
580    ?line ok = verify_sec_model(v1,  v1,  []),
581    ?line ok = verify_sec_model(v1,  v1,  [v2c]),
582    ?line ok = verify_sec_model(v2c, v2c, []),
583    ?line ok = verify_sec_model(v2c, v2c, [v1]),
584    ?line ok = verify_sec_model(v3,  usm, []),
585    ?line ok = verify_sec_model(v3,  usm, [v2c]),
586    ?line ok = verify_not_sec_model(v1,    v2c, []),
587    ?line ok = verify_not_sec_model(v1,    v3,  [v2c]),
588    ?line ok = verify_not_sec_model(v1,    v1,  [v1]),
589    ?line ok = verify_not_sec_model(v2c,   v1,  []),
590    ?line ok = verify_not_sec_model(v2c,   v3,  [v3]),
591    ?line ok = verify_not_sec_model(v2c,   v2c, [v2c]),
592    ?line ok = verify_not_sec_model(v3,    v1,  []),
593    ?line ok = verify_not_sec_model(v3,    v2c, [v1]),
594    ?line ok = verify_not_sec_model(v3,    v3,  [v2c]),
595    ?line ok = verify_not_sec_model(kalle, v3,  []),
596    ?line ok = verify_not_sec_model(1000,  v3,  []),
597    ?line ok = verify_not_sec_model(1.0,   v3,  []),
598    ok.
599
600
601verify_sec_model(M1, M2, Exclude) ->
602    case (catch snmp_conf:check_sec_model(M1, M2, Exclude)) of
603	{error, Reason} ->
604	    ?FAIL({verify_sec_model, M1, M2, Reason});
605	{ok, _} ->
606	    ok
607    end.
608
609verify_not_sec_model(M1, M2, Exclude) ->
610    case (catch snmp_conf:check_sec_model(M1, M2, Exclude)) of
611	{ok, Res} ->
612	    ?FAIL({verify_sec_model, M1, M2, Res});
613	{error, _Reason} ->
614	    ok
615    end.
616
617
618%%======================================================================
619
620check_sec_level(suite) -> [];
621check_sec_level(Config) when is_list(Config) ->
622    ?P(check_sec_level),
623    ?line ok = verify_sec_level(noAuthNoPriv),
624    ?line ok = verify_sec_level(authNoPriv),
625    ?line ok = verify_sec_level(authPriv),
626    ?line ok = verify_not_sec_level(kalle),
627    ?line ok = verify_not_sec_level("noAuthNoPriv"),
628    ?line ok = verify_not_sec_level(1000),
629    ?line ok = verify_not_sec_level(1.0),
630    ok.
631
632
633verify_sec_level(Val) ->
634    case (catch snmp_conf:check_sec_level(Val)) of
635	{error, Reason} ->
636	    ?FAIL({verify_sec_level, Val, Reason});
637	{ok, _} ->
638	    ok;
639	Error ->
640	    ?FAIL({verify_sec_level, Val, Error})
641    end.
642
643verify_not_sec_level(Val) ->
644    case (catch snmp_conf:check_sec_level(Val)) of
645	{ok, Res} ->
646	    ?FAIL({verify_sec_level, Val, Res});
647	{error, _Reason} ->
648	    ok;
649	{'EXIT', _Reason} ->
650	    ok
651    end.
652
653
654%%======================================================================
655
656check_timer(suite) -> [];
657check_timer(Config) when is_list(Config) ->
658    ?P(check_timer),
659    ?line ok = verify_timer(infinity),
660    ?line ok = verify_timer(1),
661    ?line ok = verify_timer(10),
662    ?line ok = verify_timer(2147483647),
663    ?line ok = verify_timer(2*2147483647),
664    ?line ok = verify_timer({1,1,0,0}),
665    ?line ok = verify_timer({10,10,10,10}),
666    ?line ok = verify_timer({2147483647,2147483647,2147483647,2147483647}),
667    ?line ok = verify_not_timer(ytinifni),
668    ?line ok = verify_not_timer("ytinifni"),
669    ?line ok = verify_not_timer(0),
670    ?line ok = verify_not_timer(-10),
671    ?line ok = verify_not_timer({0,1,0,0}),
672    ?line ok = verify_not_timer({1,0,0,0}),
673    ?line ok = verify_not_timer({1,1,-1,0}),
674    ?line ok = verify_not_timer({1,1,0,-1}),
675    ?line ok = verify_not_timer({1.0,1,0,0}),
676    ?line ok = verify_not_timer({1,1.0,0,0}),
677    ?line ok = verify_not_timer({1,1,1.0,0}),
678    ?line ok = verify_not_timer({1,1,0,1.0}),
679    ?line ok = verify_not_timer({"1",1,0,0}),
680    ?line ok = verify_not_timer({1,"1",0,0}),
681    ?line ok = verify_not_timer({1,1,"0",0}),
682    ?line ok = verify_not_timer({1,1,0,"0"}),
683    ok.
684
685verify_timer(Val) ->
686    case (catch snmp_conf:check_timer(Val)) of
687	{error, Reason} ->
688	    ?FAIL({verify_timer, Val, Reason});
689	{ok, _} ->
690	    ok
691    end.
692
693verify_not_timer(Val) ->
694    case (catch snmp_conf:check_timer(Val)) of
695	{ok, Res} ->
696	    ?FAIL({verify_timer, Val, Res});
697	{error, _Reason} ->
698	    ok
699    end.
700
701
702%%======================================================================
703
704read(suite) -> [];
705read(Config) when is_list(Config) ->
706    ?P(read),
707    ?SKIP(not_implemented_yet).
708
709
710%%======================================================================
711
712read_files(suite) -> [];
713read_files(Config) when is_list(Config) ->
714    ?P(read_files),
715    ?SKIP(not_implemented_yet).
716
717
718%%======================================================================
719%% Internal functions
720%%======================================================================
721
722