~brightbox/bird/debian-packaging

« back to all changes in this revision

Viewing changes to filter/test.conf

  • Committer: Ondřej Surý
  • Date: 2013-11-25 14:59:24 UTC
  • Revision ID: git-v1:a3c058b8752bd98df2231ac88d94931fdb4e0c65
New upstream version 1.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
        print "5 = ", p2.len;
107
107
        print "Delete 3:   ", delete(p2, 3);
108
108
        print "Filter 1-3: ", filter(p2, [1..3]);
109
 
        
 
109
 
110
110
        pm1 = [= 1 2 * 3 4 5 =];
111
111
        p2 = prepend( + empty +, 5 );
112
112
        p2 = prepend( p2, 4 );
265
265
int set is;
266
266
pair set ps;
267
267
ec set ecs;
 
268
ip set ips;
268
269
prefix set pxs;
269
 
string s;
 
270
string st;
270
271
{
271
272
        print "1a-a1 = 30: ", '1a-a1'; 
272
273
        print "Testing filter language:";
351
352
        print "Testing EC set, false: ", (ro, 10, 20) ~ ecs, " ", (rt, 10, 21) ~ ecs, " ", (ro, 100000, 99) ~ ecs,
352
353
                " ", (ro, 12345, 10) ~ ecs, " ", (rt, 12346, 0) ~ ecs, " ", (ro, 0.1.134.160, 150) ~ ecs;
353
354
 
354
 
        s = "Hello";
355
 
        print "Testing string: ", s, " true: ", s ~ "Hell*", " false: ", s ~ "ell*";
 
355
        st = "Hello";
 
356
        print "Testing string: ", st, " true: ", st ~ "Hell*", " false: ", st ~ "ell*";
356
357
        
357
358
        b = true;
358
359
        print "Testing bool: ", b, ", ", !b;
360
361
        if ( b = true ) then print "Testing bool comparison b = true: ", b;
361
362
        else { print "*** FAIL: TRUE test failed" ; quitbird; }
362
363
        
 
364
        ips = [ 1.1.1.0 .. 1.1.1.255, 1.2.2.2];
 
365
        print "Testing IP sets: ";
 
366
        print ips;
 
367
        print "  must be true:  ",      1.1.1.0 ~ ips, ",", 1.1.1.100 ~ ips, ",", 1.2.2.2 ~ ips;
 
368
        print "  must be false: ",      1.1.0.255 ~ ips, ",", 1.1.2.0  ~ ips, ",", 1.2.2.3 ~ ips, ",", 192.168.1.1 ~ ips;
 
369
 
363
370
        pxs = [ 1.2.0.0/16, 1.4.0.0/16+];
364
371
        print "Testing prefix sets: ";
365
372
        print pxs;
386
393
 
387
394
        print "1.2.3.4 = ", onetwo;
388
395
 
 
396
        i = 4200000000;
 
397
        print "4200000000 = ", i, "   false: ", i = 4200000000, " ", i > 4100000000, "   false: ", i > 4250000000;
 
398
 
389
399
        test_undef(2);
390
400
        test_undef(3);
391
401
        test_undef(2);