Skip to content

Commit 97ea6ad

Browse files
committed
Test snmp on Windows CI
We use the snmpd which is now bundled with the net-snmp dependency, and the MIBS which are also shipped with it. We also fix the tests/snmpd.conf, and mark two failing tests as XFAIL. Closes GH-8503.
1 parent 89fa775 commit 97ea6ad

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

appveyor/test_task.bat

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ if not exist "%PHP_BUILD_CACHE_ENCHANT_DICT_DIR%\en_US.aff" (
8989
mkdir %LOCALAPPDATA%\enchant\hunspell
9090
copy %PHP_BUILD_CACHE_ENCHANT_DICT_DIR%\* %LOCALAPPDATA%\enchant\hunspell
9191

92+
rem prepare for snmp
93+
set MIBDIRS=%DEPS_DIR%\share\mibs
94+
start %DEPS_DIR%\bin\snmpd.exe -C -c %APPVEYOR_BUILD_FOLDER%\ext\snmp\tests\snmpd.conf -Ln
95+
9296
set PHP_BUILD_DIR=%PHP_BUILD_OBJ_DIR%\Release
9397
if "%THREAD_SAFE%" equ "1" set PHP_BUILD_DIR=%PHP_BUILD_DIR%_TS
9498

@@ -101,7 +105,7 @@ rem work-around for some spawned PHP processes requiring OpenSSL
101105
echo extension=php_openssl.dll >> %PHP_BUILD_DIR%\php.ini
102106

103107
rem remove ext dlls for which tests are not supported
104-
for %%i in (imap ldap oci8_12c pdo_firebird pdo_oci snmp) do (
108+
for %%i in (imap ldap oci8_12c pdo_firebird pdo_oci) do (
105109
del %PHP_BUILD_DIR%\php_%%i.dll
106110
)
107111

@@ -116,6 +120,8 @@ nmake test TESTS="%OPCACHE_OPTS% -q --offline --show-diff --show-slow 1000 --set
116120

117121
set EXIT_CODE=%errorlevel%
118122

123+
taskkill /f /im snmpd.exe
124+
119125
appveyor PushArtifact %TEST_PHP_JUNIT%
120126

121127
if %EXIT_CODE% GEQ 1 (

ext/snmp/tests/bug64159.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ snmp
77
--SKIPIF--
88
<?php
99
require_once(__DIR__.'/skipif.inc');
10+
if (PHP_OS_FAMILY === "Windows") die("xfail fails on Windows for unknown reasons");
1011
?>
1112
--ENV--
1213
MIBS=noneXistent

ext/snmp/tests/snmp_getvalue.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ snmp
77
--SKIPIF--
88
<?php
99
require_once(__DIR__.'/skipif.inc');
10+
if (PHP_OS_FAMILY === "Windows") die("xfail fails on Windows for unknown reasons");
1011
?>
1112
--FILE--
1213
<?php

ext/snmp/tests/snmpd.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ rocommunity public 127.0.0.1
55
rocommunity6 public ::1
66
rwcommunity private 127.0.0.1
77

8-
Do not enable them - being set here they make appropriate OID switch into r/o
8+
# Do not enable them - being set here they make appropriate OID switch into r/o
99
#syslocation "Somewhere in the world"
1010
#syscontact "root"
1111

0 commit comments

Comments
 (0)