File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -518,4 +518,18 @@ class APIModelsDHCPServerTestCase extends TestCase {
518518 $ dhcp_server ->update (apply: true );
519519 $ this ->assert_str_contains ((new Command ('cat /var/dhcpd/etc/dhcpd.conf ' ))->output , 'peer address 192.168.1.2; ' );
520520 }
521+
522+ /**
523+ * Ensures non-static interfaces are exempt from DHCP server initialization. This is a regression test for #781
524+ */
525+ public function test_non_static_interfaces_exempt_from_dhcp_server_initialization (): void {
526+ # Temporarily add a mock interface using pppoe for IPv4
527+ Model::set_config ('interfaces/opt1/ipaddr ' , 'pppoe ' );
528+
529+ # Init a DHCP server model. This should trigger initialization logic.
530+ new DHCPServer ();
531+
532+ # Ensure a config entry was not initialized for the non-static interface
533+ $ this ->assert_is_false (array_key_exists ('opt1 ' , Model::get_config ('dhcpd ' )));
534+ }
521535}
You can’t perform that action at this time.
0 commit comments