[Xorp-hackers] Question re RIB regression tests

Pavlin Radoslavov pavlin@icir.org
Wed, 27 Oct 2004 19:26:17 -0700


> This is probably trivial but I'm trying to get my head around the RIB code
> at the moment.
> 
> When running regression tests against the RIB using the 'direct' interface
> (as opposed to the XRL interface), the 'commands' test script reports a
> failure. I have traced this back to test_rib_direct never calling
> rib_manager.start(). Is this intentional?

If you call RibManager::start(), it will call VifManager::start()
which itself will call ifmgr_startup(). That will initiate
registration with the FEA to obtain network interface information
(using libfeaclient). In this particular test there is no FEA, hence
the result is probably unpredictable.

On the other hand, the above logic is based on internal knowledge
how RibManager::start() works, hence this shouldn't be used as
a deciding factor whether/when to call it.

The right solution would be always to call RibManager::start(), and
then fix all other problems that may show up when the RIB is running
in isolation without the FEA.

Pavlin

> 
> I've attached a patch which makes the two tests more similar.
> 
> BMS
> 
> --yrj/dFKFPuw6o+aM
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: attachment; filename="test_rib_direct.diff"
> 
> Index: test_rib_direct.cc
> ===================================================================
> RCS file: /usr/local/www/data/cvs/xorp/rib/test_rib_direct.cc,v
> retrieving revision 1.14
> diff -u -p -r1.14 test_rib_direct.cc
> --- test_rib_direct.cc	6 Oct 2004 21:21:07 -0000	1.14
> +++ test_rib_direct.cc	28 Oct 2004 01:42:26 -0000
> @@ -74,12 +74,14 @@ parser_main()
>      RibManager rib_manager(eventloop, xrl_std_router_rib, "fea");
>      rib_manager.enable();
>  
> +    wait_until_xrl_router_is_ready(eventloop, xrl_std_router_rib);
> +
> +    rib_manager.start();
> +
>      RIB<IPv4> rib(UNICAST, rib_manager, eventloop);
>      DummyRegisterServer register_server;
>  
> -    rib.initialize_register(register_server);
> -
> -    wait_until_xrl_router_is_ready(eventloop, xrl_std_router_rib);
> +    rib.initialize(register_server);
>  
>      RibParser parser(rib);
>  
> 
> --yrj/dFKFPuw6o+aM--
> _______________________________________________
> Xorp-hackers mailing list
> Xorp-hackers@icir.org
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers