Esempio n. 1
0
 function test_set_skip_multi()
 {
     $pf = new pf();
     $pf->parseRulebase('set skip on { lo0, enc0 }');
     $this->assertEqual(trim($pf->generate(false, false)), 'set skip on { lo0 enc0 }');
 }
Esempio n. 2
0
 function test_other()
 {
     $pf = new pf();
     $pf->parseRulebase('pass all flags S/SA');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all flags S/SA');
     $pf = new pf();
     $pf->parseRulebase('pass inet all');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass inet all');
     $pf = new pf();
     $pf->parseRulebase('pass inet6 all');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass inet6 all');
     $pf = new pf();
     $pf->parseRulebase('pass all user root');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all user root');
     $pf = new pf();
     $pf->parseRulebase('pass all user {root www}');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all user { root www }');
     $pf = new pf();
     $pf->parseRulebase('pass all group wheel');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all group wheel');
     $pf = new pf();
     $pf->parseRulebase('pass all queue default');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all queue default');
     $pf = new pf();
     $pf->parseRulebase('pass all queue (default, small)');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all queue (default, small)');
     $pf = new pf();
     $pf->parseRulebase('pass all label test');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all label "test"');
     $pf = new pf();
     $pf->parseRulebase('pass all tag test');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all tag "test"');
     $pf = new pf();
     $pf->parseRulebase('pass all tagged test');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all tagged "test"');
     $pf = new pf();
     $pf->parseRulebase('pass all probability 10');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all probability 10');
     $pf = new pf();
     $pf->parseRulebase('pass fastroute all');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass fastroute all');
     $pf = new pf();
     $pf->parseRulebase('pass route-to 1.2.3.4 all');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass route-to 1.2.3.4 all');
     $pf = new pf();
     $pf->parseRulebase('pass reply-to 1.2.3.4 all');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass reply-to 1.2.3.4 all');
     $pf = new pf();
     $pf->parseRulebase('pass dup-to 1.2.3.4 all');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass dup-to 1.2.3.4 all');
     $pf = new pf();
     $pf->parseRulebase('pass all allow-opts');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all allow-opts');
     $pf = new pf();
     $pf->parseRulebase('block in from any os "nmap" to any');
     $this->assertEqual(trim($pf->generate(false, false)), 'block in from any os "nmap" to any');
     $pf = new pf();
     $pf->parseRulebase('block in from any os { "nmap", "Windows 95" } to any');
     $this->assertEqual(trim($pf->generate(false, false)), 'block in from any os { "nmap" "Windows 95" } to any');
     $pf = new pf();
     $pf->parseRulebase('pass in \\
  all');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass in all');
     $pf = new pf();
     $pf->parseRulebase('pass in route-to ($inf1 $gw1) all');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass in route-to { ($inf1 $gw1) } all');
     $pf = new pf();
     $pf->parseRulebase('pass in route-to { ($inf1 $gw1), ($inf2, $gw2) } all');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass in route-to { ($inf1 $gw1) ($inf2 $gw2) } all');
 }
Esempio n. 3
0
 function test_anchors()
 {
     $pf = new pf();
     $pf->parseRulebase('nat-anchor "authpf/*"');
     $this->assertEqual(trim($pf->generate(false, false)), 'nat-anchor "authpf/*"');
     $pf = new pf();
     $pf->parseRulebase('rdr-anchor "authpf/*"');
     $this->assertEqual(trim($pf->generate(false, false)), 'rdr-anchor "authpf/*"');
     $pf = new pf();
     $pf->parseRulebase('rdr-anchor "authpf/*"');
     $this->assertEqual(trim($pf->generate(false, false)), 'rdr-anchor "authpf/*"');
 }