Skip to content

Commit 53ad692

Browse files
tests: adjustments to DHCPServer and DHCPRelay model tests
1 parent 67fba19 commit 53ad692

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsDHCPRelayTestCase.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class APIModelsDHCPRelayTestCase extends TestCase {
1818
$dhcp_server->update();
1919
}
2020
if ($apply) {
21-
(new DHCPServer())->apply();
21+
(new DHCPServer(async: false))->apply();
2222
}
2323
}
2424

@@ -81,7 +81,7 @@ class APIModelsDHCPRelayTestCase extends TestCase {
8181
$this->disable_dhcp_servers(apply: true);
8282

8383
# Ensure the DHCPRelay is enabled
84-
$dhcp_relay = new DHCPRelay(enable: true, server: ['1.2.3.4']);
84+
$dhcp_relay = new DHCPRelay(enable: true, interface: ["lan"], server: ['1.2.3.4']);
8585
$dhcp_relay->update();
8686

8787
# Ensure the DHCP relay service is running with the correct arguments
@@ -90,7 +90,7 @@ class APIModelsDHCPRelayTestCase extends TestCase {
9090
$wan_if = $this->env['PFREST_WAN_IF'];
9191
$this->assert_str_contains(
9292
$dhcrelay_process->output,
93-
"/usr/local/sbin/dhcrelay -id $lan_if -iu $wan_if -a -m replace 1.2.3.4",
93+
"/usr/local/sbin/dhcrelay -id $lan_if -iu $wan_if 1.2.3.4",
9494
);
9595

9696
# Disable the DHCPRelay

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsDHCPServerTestCase.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class APIModelsDHCPServerTestCase extends TestCase {
3434
/**
3535
* Ensures that a DHCP server cannot be enabled on an interface is already running a DHCP relay.
3636
*/
37-
public function test_cannot_enable_dhcp_server_with_relay_running() {
37+
public function test_cannot_enable_dhcp_server_with_relay_running(): void {
3838
$this->assert_throws_response(
3939
response_id: 'DHCP_SERVER_CANNOT_BE_ENABLED_WITH_DHCP_RELAY',
4040
code: 400,
@@ -43,7 +43,7 @@ class APIModelsDHCPServerTestCase extends TestCase {
4343
$dhcp_server = new DHCPServer(id: 'lan', async: false);
4444

4545
# Temporarily change the `lan` interface to use dhcp IPv4
46-
Model::set_config('dhcrelay/interface', 'lan');
46+
Model::set_config('dhcrelay/enable', "");
4747

4848
# Try to enable the DHCP server
4949
$dhcp_server->validate_enable(enable: true);

0 commit comments

Comments
 (0)