1# test router priority with one interface state machine (ism)
2# ospfd has prio 1, ism of the test has prio 2
3# test that ospfd gets bdr (does not work), ism gets dr
4
5use strict;
6use warnings;
7use Default qw($area $tap_number $ospfd_ip $ospfd_rtrid);
8
9our %tst_args = (
10    ospfd => {
11	conf => {
12	    areas => {
13		$area => {
14		    "tap$tap_number:$ospfd_ip" => {
15			'router-priority' => '1',
16		    },
17		},
18	    },
19	},
20    },
21    client => {
22	state => {
23	    pri => 2,
24	},
25	tasks => [
26	    {
27		name => "receive hello with dr 0.0.0.0 bdr 0.0.0.0, ".
28		    "enter $ospfd_rtrid as our neighbor",
29		check => {
30		    dr   => "0.0.0.0",
31		    bdr  => "0.0.0.0",
32		    nbrs => [],
33		},
34		state => {
35		    nbrs => [ $ospfd_rtrid ],
36		},
37	    },
38	    {
39		name => "wait for neighbor 10.188.0.18 in received hello",
40		check => {
41		    dr  => "0.0.0.0",
42		    bdr => "0.0.0.0",
43		},
44		wait => {
45		    nbrs => [ "10.188.0.18" ],
46		},
47		timeout => 5,  # 2 * hello interval + 1 second
48	    },
49	    {
50		name => "we are 2-way, wait for dr 10.188.6.18 and ".
51		    "bdr $ospfd_ip in received hello",
52		check => {
53		    nbrs => [ "10.188.0.18" ],
54		},
55		wait => {
56		    dr => "10.188.6.18",
57		    bdr  => "0.0.0.0"  # XXX should be $ospfd_ip
58		},
59		timeout => 11,  # dead interval + hello interval + 1 second
60	    },
61	],
62    },
63);
64
651;
66