~ubuntu-branches/ubuntu/hardy/net-snmp/hardy-proposed

« back to all changes in this revision

Viewing changes to local/passtest.pl

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-05-10 22:20:23 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070510222023-2yqbm8wasqpni3c1
Tags: 5.3.1-5ubuntu1
* Merge from Debian unstable.
* Remaining Ubuntu changes:
  - Remove stop links from rc0 and rc6
* Munge Maintainer field as per spec. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
$place = ".1.3.6.1.4.1.2021.255";
 
3
$req = $ARGV[1];
 
4
 
 
5
if ($ARGV[0] eq "-s") {
 
6
  open LOG,">>/tmp/passtest.log";
 
7
  print LOG "@ARGV\n";
 
8
  close LOG;
 
9
  exit 0;
 
10
}
 
11
 
 
12
if ($ARGV[0] eq "-n") {
 
13
  if ($req eq "$place") { $ret = "$place.1";}
 
14
  elsif ($req eq "$place.1") { $ret = "$place.2.1";}
 
15
  elsif ($req eq "$place.2.1") { $ret = "$place.2.2";}
 
16
  elsif ($req eq "$place.2.2") { $ret = "$place.3";}
 
17
  elsif ($req eq "$place.3") { $ret = "$place.4";}
 
18
  elsif ($req eq "$place.4") { $ret = "$place.5";}
 
19
  elsif ($req eq "$place.5") { $ret = "$place.6";}
 
20
  else {exit 0;}
 
21
}
 
22
else {
 
23
  if ($req eq "$place") { exit 0;}
 
24
  else {$ret = $req;}
 
25
}
 
26
 
 
27
print "$ret\n";
 
28
 
 
29
if ($ret eq "$place.1") { print "string\nlife the universe and everything\n"; exit 0;}
 
30
elsif ($ret eq "$place.2.1") { print "integer\n42\n"; exit 0;}
 
31
elsif ($ret eq "$place.2.2") { print "objectid\n.1.3.6.1.4.42.42.42\n"; exit 0;}
 
32
elsif ($ret eq "$place.3") { print "timeticks\n363136200\n"; exit 0;}
 
33
elsif ($ret eq "$place.4") { print "ipaddress\n127.0.0.1\n"; exit 0;}
 
34
elsif ($ret eq "$place.5") { print "counter\n42\n"; exit 0;}
 
35
elsif ($ret eq "$place.6") { print "gauge\n42\n"; exit 0;}
 
36
else { print "string\nack... $ret $req\n"; exit 0; }