Advisor

This scenarios checks the correct functioning of the advisor DHCP functions.

Test DHCP Server Advisor

Description

This scenario configures and check an advisor works properly for DHCP-server. First you should configure at least a server (for this scenario there are 2). Then configure the alarm and the advisor linked to the alarm and the server. By default alarmas are configured as false, so 'not al' will be true. Then, the advisor will be true and the process will be running. Next, the value of the advisor is changed to 'al', so the process will not be running. Finally, the advisor is changed to the previous value, so the process will be running.

Scenario

Step 1: Set the following configuration in DUT0:

set interfaces ethernet eth0 address 10.0.0.1/24
set interfaces ethernet eth0 vif 100 address 11.0.0.1/24
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 start 10.0.0.5 stop 10.0.0.5
set service dhcp-server shared-network dhcp-2 subnet 11.0.0.0/24 start 11.0.0.5 stop 11.0.0.5
set service dhcp-server shared-network dhcp advisor adv
set service dhcp-server shared-network dhcp-2 advisor adv
set system alarm al
set system advisor adv test 'not al'

Step 2: Run command system processes show | grep dhcpd at DUT0 and check if output contains the following tokens:

/usr/sbin/dhcpd
Show output
30493 ?        Ds     0:00 /usr/sbin/dhcpd -f -q -pf /run/dhcpd_main.pid -cf /etc/dhcp/dhcpd_main.conf -lf /config/dhcpd_main.leases eth0.100 eth0
30514 ttyS0    S+     0:00 sh -c set -- system processes show; declare -x -r LESSSECURE=1; (ps ax ) |& grep dhcpd
30516 ttyS0    S+     0:00 grep dhcpd

Step 3: Set the following configuration in DUT0:

set system advisor adv test al

Step 4: Run command system processes show | grep dhcpd at DUT0 and check if output does not contain the following tokens:

/usr/sbin/dhcpd
Show output
30541 ttyS0    S+     0:00 sh -c set -- system processes show; declare -x -r LESSSECURE=1; (ps ax ) |& grep dhcpd
30543 ttyS0    S+     0:00 grep dhcpd

Step 5: Set the following configuration in DUT0:

set system advisor adv test 'not al'

Step 6: Run command system processes show | grep dhcpd at DUT0 and check if output contains the following tokens:

/usr/sbin/dhcpd
Show output
30568 ?        Ss     0:00 /usr/sbin/dhcpd -f -q -pf /run/dhcpd_main.pid -cf /etc/dhcp/dhcpd_main.conf -lf /config/dhcpd_main.leases eth0.100 eth0
30571 ttyS0    S+     0:00 sh -c set -- system processes show; declare -x -r LESSSECURE=1; (ps ax ) |& grep dhcpd
30573 ttyS0    S+     0:00 grep dhcpd