Revert "Revert "and added files""
[bcm963xx.git] / userapps / opensource / net-snmp / perl / agent / default_store / test.pl
1 # Before `make install' is performed this script should be runnable with
2 # `make test'. After `make install' it should work as `perl test.pl'
3
4 ######################### We start with some black magic to print on failure.
5
6 # Change 1..1 below to 1..last_test_to_print .
7 # (It may become useful if the test is moved to ./t subdirectory.)
8
9 BEGIN { $| = 1; 
10
11         %tests = ( 
12                   "NETSNMP_DS_AGENT_VERBOSE"               => 0,
13                   "NETSNMP_DS_AGENT_ROLE"                  => 1,
14                   "NETSNMP_DS_AGENT_NO_ROOT_ACCESS"        => 2,
15                   "NETSNMP_DS_AGENT_AGENTX_MASTER"         => 3,
16                   "NETSNMP_DS_AGENT_QUIT_IMMEDIATELY"      => 4,
17                   "NETSNMP_DS_AGENT_DISABLE_PERL"          => 5,
18                   "NETSNMP_DS_AGENT_PROGNAME"              => 0,
19                   "NETSNMP_DS_AGENT_X_SOCKET"              => 1,
20                   "NETSNMP_DS_AGENT_PORTS"                 => 2,
21                   "NETSNMP_DS_AGENT_INTERNAL_SECNAME"      => 3,
22                   "NETSNMP_DS_AGENT_PERL_INIT_FILE"        => 4,
23                   "NETSNMP_DS_AGENT_FLAGS"                 => 0,
24                   "NETSNMP_DS_AGENT_USERID"                => 1,
25                   "NETSNMP_DS_AGENT_GROUPID"               => 2,
26                   "NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL"  => 3,
27                   );
28
29         print "1.." . (scalar(keys(%tests)) + 2) . "\n"; 
30     }
31 END {print "not ok 1\n" unless $loaded;}
32 use NetSNMP::agent::default_store (':all');
33 $loaded = 1;
34 print "ok 1\n";
35
36 ######################### End of black magic.
37
38 # Insert your test code below (better if it prints "ok 13"
39 # (correspondingly "not ok 13") depending on the success of chunk 13
40 # of the test code):
41
42 $c = 2;
43 foreach my $i (keys(%tests)) {
44     my $str = "NetSNMP::agent::default_store::$i";
45     my $val = eval $str;
46 #    print "$i -> $val -> $tests{$i}\n";
47     $c++;
48     print (($val eq $tests{$i})?"ok $c\n" : "not ok $c\n#  error:  name=$i value_expected=$tests{$i}  value_got=$val \n");
49 }