Revision 04632fd7 filter/test.conf

View differences:

filter/test.conf
16 16
define p23 = (2, 3);
17 17
define ip1222 = 1.2.2.2;
18 18

  
19
define net10 = 10.0.0.0/8;
20
define netdoc = 2001:db8::/32;
21

  
22

  
19 23
function onef(int a)
20 24
{
21 25
	return 1;
......
55 59
	return 15;
56 60
}
57 61

  
62
/*
58 63
roa table rl
59 64
{
60 65
	roa 10.110.0.0/16 max 16 as 1000;
......
80 85
	      " ", roa_check(rl, 10.130.30.0/24, 3000) = ROA_INVALID,
81 86
	      " ", roa_check(rl, 10.130.130.0/24, 3000) = ROA_VALID;
82 87
}
88
*/
83 89

  
84 90
function path_test()
85 91
bgpmask pm1;
......
232 238
function test_pxset(prefix set pxs)
233 239
{
234 240
	print pxs;
235
	print "  must be true:  ",	10.0.0.0/8  ~ pxs, ",", 10.0.0.0/10  ~ pxs, ",", 10.0.0.0/12 ~ pxs, ",",
241
	print "  must be true:  ",	net10  ~ pxs, ",", 10.0.0.0/10  ~ pxs, ",", 10.0.0.0/12 ~ pxs, ",",
236 242
					20.0.0.0/24 ~ pxs, ",", 20.0.40.0/24 ~ pxs, ",", 20.0.0.0/26 ~ pxs, ",",
237 243
					20.0.100.0/26 ~ pxs, ",", 20.0.0.0/28 ~ pxs, ",", 20.0.255.0/28 ~ pxs;
238 244
	print "  must be false: ",	10.0.0.0/7 ~ pxs,  ",", 10.0.0.0/13 ~ pxs, ",", 10.0.0.0/16 ~ pxs, ",",
......
312 318

  
313 319
	px = 1.2.0.0/18;
314 320
	print "Testing prefixes: 1.2.0.0/18 = ", px;
315
	print "  must be true:  ",	192.168.0.0/16 ~ 192.168.0.0/16, " ", 192.168.0.0/17 ~ 192.168.0.0/16, " ", 192.168.254.0/24 ~ 192.168.0.0/16;
316
	print "  must be false: ",	192.168.0.0/15 ~ 192.168.0.0/16, " ", 192.160.0.0/17 ~ 192.168.0.0/16;
321
	print "  must be true:  ",	192.168.0.0/16 ~ 192.168.0.0/16, " ", 192.168.0.0/17 ~ 192.168.0.0/16, " ", 192.168.254.0/24 ~ 192.168.0.0/16, " ", netdoc ~ 2001::/16;
322
	print "  must be false: ",	192.168.0.0/15 ~ 192.168.0.0/16, " ", 192.160.0.0/17 ~ 192.168.0.0/16, " ", px ~ netdoc;
317 323

  
318 324
	p = 127.1.2.3;
319 325
	print "Testing mask : 127.0.0.0 = ", p.mask(8);
320
	
326

  
321 327
	pp = (1, 2);
322 328
	print "Testing pairs: (1,2) = ", (1,2), " = ", pp, " = ", (1,1+1), " = ", 'mkpair-a'(2);
323 329
	print "  must be true:  ", (1,2) = (1,1+1);
......
397 403
	print "1.2.3.4 = ", onetwo;
398 404

  
399 405
	i = 4200000000;
400
	print "4200000000 = ", i, "   false: ", i = 4200000000, " ", i > 4100000000, "   false: ", i > 4250000000;
406
	print "4200000000 = ", i, "    true: ", i = 4200000000, " ", i > 4100000000, "   false: ", i > 4250000000;
401 407

  
402 408
	test_undef(2);
403 409
	test_undef(3);

Also available in: Unified diff