summaryrefslogtreecommitdiff
path: root/regress/usr.sbin/ospfd/args-ifstate-pri-ism.pl
blob: b42ffeaeeeb5bb5df6b9440d1708102737ff87f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# test router priority with one interface state machine (ism)
# ospfd has prio 0, ism of the test has prio 1
# test that ism gets dr, there is no bdr

use strict;
use warnings;
use Default qw($area $tap_number $ospfd_ip $ospfd_rtrid);

our %tst_args = (
    ospfd => {
	conf => {
	    areas => {
		$area => {
		    "tap$tap_number:$ospfd_ip" => {
			'router-priority' => '0',
		    },
		},
	    },
	},
    },
    client => {
	state => {
	    pri => 1,
	},
	tasks => [
	    {
		name => "receive hello with dr 0.0.0.0 bdr 0.0.0.0, ".
		    "enter $ospfd_rtrid as our neighbor",
		check => {
		    dr   => "0.0.0.0",
		    bdr  => "0.0.0.0",
		    nbrs => [],
		},
		state => {
		    nbrs => [ $ospfd_rtrid ],
		},
	    },
	    {
		name => "wait for neighbor 10.188.0.18 in received hello",
		check => {
		    # XXX dr flipping between "0.0.0.0" and "10.188.6.18"
		    bdr => "0.0.0.0",
		},
		wait => {
		    nbrs => [ "10.188.0.18" ],
		},
		timeout => 5,  # 2 * hello interval + 1 second
	    },
	    {
		name => "we are 2-way, wait for dr 10.188.6.18 and ".
		    "no bdr in received hello",
		check => {
		    nbrs => [ "10.188.0.18" ],
		},
		wait => {
		    dr => "10.188.6.18",
		    bdr  => "0.0.0.0",
		},
		timeout => 11,  # dead interval + hello interval + 1 second
	    },
	],
    },
);

1;