dhcp: add dhcp scope stats (#1840)

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2025-01-20 11:03:03 +00:00
committed by GitHub
parent d31ce0507c
commit 5836a7dbf2
8 changed files with 973 additions and 195 deletions

View File

@@ -0,0 +1,24 @@
package dhcpsapi
import (
"errors"
"testing"
"github.com/stretchr/testify/require"
"golang.org/x/sys/windows"
)
func TestGetDHCPV4ScopeStatistics(t *testing.T) {
t.Parallel()
if procDhcpGetSuperScopeInfoV4.Find() != nil {
t.Skip("DhcpGetSuperScopeInfoV4 is not available")
}
_, err := GetDHCPV4ScopeStatistics()
if errors.Is(err, windows.Errno(1753)) {
t.Skip(err.Error())
}
require.NoError(t, err)
}