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/dhcpdShow output
5617 ? 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 5638 ttyS0 S+ 0:00 sh -c set -- system processes show; declare -x -r LESSSECURE=1; (ps ax ) |& grep dhcpd 5640 ttyS0 R+ 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/dhcpdShow output
5665 ttyS0 S+ 0:00 sh -c set -- system processes show; declare -x -r LESSSECURE=1; (ps ax ) |& grep dhcpd 5667 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/dhcpdShow output
5692 ? 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 5695 ttyS0 S+ 0:00 sh -c set -- system processes show; declare -x -r LESSSECURE=1; (ps ax ) |& grep dhcpd 5697 ttyS0 S+ 0:00 grep dhcpd