@@ -135,12 +135,6 @@ class DrvFsTests
135135 Logfile << TestMode;
136136 VERIFY_NO_THROW (LxsstuRunTest (Command.str ().c_str (), Logfile.str ().c_str ()));
137137
138- if (DrvFsMode.has_value () && DrvFsMode.value () == DrvFsMode::VirtioFs)
139- {
140- LogSkipped (" TODO: debug test for virtiofs" );
141- return ;
142- }
143-
144138 //
145139 // Check that the read-only attribute has been changed.
146140 //
@@ -173,8 +167,15 @@ class DrvFsTests
173167 VERIFY_NO_THROW (VerifyDrvFsSymlink (LXSST_DRVFS_SYMLINK_TEST_DIR " \\ ntlink7" , L" ntlink2" , true ));
174168 VERIFY_NO_THROW (VerifyDrvFsSymlink (LXSST_DRVFS_SYMLINK_TEST_DIR " \\ ntlink8" , L" foo\uf03a bar" , false ));
175169
176- VERIFY_NO_THROW (VerifyDrvFsLxSymlink (LXSST_DRVFS_SYMLINK_TEST_DIR " \\ lxlink1" ));
177- VERIFY_NO_THROW (VerifyDrvFsLxSymlink (LXSST_DRVFS_SYMLINK_TEST_DIR " \\ lxlink2" ));
170+ if (DrvFsMode.has_value () && DrvFsMode.value () == DrvFsMode::VirtioFs)
171+ {
172+ LogInfo (" TODO: debug VerifyDrvFsLxSymlink variations on virtiofs" );
173+ }
174+ else
175+ {
176+ VERIFY_NO_THROW (VerifyDrvFsLxSymlink (LXSST_DRVFS_SYMLINK_TEST_DIR " \\ lxlink1" ));
177+ VERIFY_NO_THROW (VerifyDrvFsLxSymlink (LXSST_DRVFS_SYMLINK_TEST_DIR " \\ lxlink2" ));
178+ }
178179
179180 // Since target resolution is done on the Windows side in Plan 9, it is able to create an NT
180181 // link if the target path traverses an existing NT link (this is actually better than WSL 1).
@@ -228,10 +229,16 @@ class DrvFsTests
228229 VERIFY_NO_THROW (DrvFsCommon (LX_DRVFS_DISABLE_NONE, Mode));
229230 }
230231
231- void DrvFsFat () const
232+ void DrvFsFat (DrvFsMode Mode)
232233 {
233234 SKIP_TEST_ARM64 ();
234235
236+ if (Mode == DrvFsMode::VirtioFs)
237+ {
238+ LogSkipped (" VirtioFS currently only supports mounting full drives" );
239+ return ;
240+ }
241+
235242 constexpr auto MountPoint = " C:\\ lxss_fat" ;
236243 constexpr auto VhdPath = " C:\\ lxss_fat.vhdx" ;
237244 auto Cleanup = wil::scope_exit ([MountPoint, VhdPath] { DeleteVolume (MountPoint, VhdPath); });
@@ -241,10 +248,16 @@ class DrvFsTests
241248 LxsstuRunTest ((L" bash -c '" + SkipUnstableTestEnvVar + L" /data/test/wsl_unit_tests drvfs -m 3'" ).c_str (), L" drvfs3" ));
242249 }
243250
244- void DrvFsSmb () const
251+ void DrvFsSmb (DrvFsMode Mode)
245252 {
246253 SKIP_TEST_ARM64 ();
247254
255+ if (Mode == DrvFsMode::VirtioFs)
256+ {
257+ LogSkipped (" TODO: debug virtiofs handling of //localhost/C$ style paths" );
258+ return ;
259+ }
260+
248261 VERIFY_NO_THROW (
249262 LxsstuRunTest ((L" bash -c '" + SkipUnstableTestEnvVar + L" /data/test/wsl_unit_tests drvfs -m 4'" ).c_str (), L" drvfs4" ));
250263 }
@@ -312,20 +325,20 @@ class DrvFsTests
312325 {
313326 SKIP_TEST_ARM64 ();
314327
315- if (Mode == DrvFsMode::VirtioFs)
316- {
317- LogSkipped (" TODO: debug test for virtiofs" );
318- return ;
319- }
320-
321328 VERIFY_NO_THROW (LxsstuRunTest (L" /data/test/wsl_unit_tests xattr drvfs" , L" xattr_drvfs" ));
322329 }
323330
324- void DrvFsReFs () const
331+ void DrvFsReFs (DrvFsMode Mode)
325332 {
326333 SKIP_TEST_ARM64 ();
327334 WSL_TEST_VERSION_REQUIRED (wsl::windows::common::helpers::WindowsBuildNumbers::Germanium);
328335
336+ if (Mode == DrvFsMode::VirtioFs)
337+ {
338+ LogSkipped (" VirtioFS currently only supports mounting full drives" );
339+ return ;
340+ }
341+
329342 constexpr auto MountPoint = " C:\\ lxss_refs" ;
330343 constexpr auto VhdPath = " C:\\ lxss_refs.vhdx" ;
331344 auto Cleanup = wil::scope_exit ([MountPoint, VhdPath] { DeleteVolume (MountPoint, VhdPath); });
@@ -1072,13 +1085,13 @@ class WSL1 : public DrvFsTests
10721085 TEST_METHOD (DrvFsFat)
10731086 {
10741087 WSL1_TEST_ONLY ();
1075- DrvFsTests::DrvFsFat ();
1088+ DrvFsTests::DrvFsFat (DrvFsMode::WSL1 );
10761089 }
10771090
10781091 TEST_METHOD (DrvFsSmb)
10791092 {
10801093 WSL1_TEST_ONLY ();
1081- DrvFsTests::DrvFsSmb ();
1094+ DrvFsTests::DrvFsSmb (DrvFsMode::WSL1 );
10821095 }
10831096
10841097 TEST_METHOD (DrvFsMetadata)
@@ -1108,8 +1121,8 @@ class WSL1 : public DrvFsTests
11081121 else \
11091122 { \
11101123 VERIFY_ARE_EQUAL (LxsstuInitialize (FALSE ), TRUE ); \
1111- VERIFY_ARE_EQUAL (LxsstuLaunchWsl (LXSST_TESTS_INSTALL_COMMAND_LINE), 0 ); \
11121124 m_config.reset (new WslConfigChange (LxssGenerateTestConfig ({.drvFsMode = DrvFsMode::##_mode##}))); \
1125+ VERIFY_ARE_EQUAL (LxsstuLaunchWsl (LXSST_TESTS_INSTALL_COMMAND_LINE), 0 ); \
11131126 } \
11141127\
11151128 return true ; \
@@ -1147,13 +1160,13 @@ class WSL1 : public DrvFsTests
11471160 TEST_METHOD (DrvFsFat) \
11481161 { \
11491162 WSL2_TEST_ONLY (); \
1150- DrvFsTests::DrvFsFat (); \
1163+ DrvFsTests::DrvFsFat (DrvFsMode::##_mode## ); \
11511164 } \
11521165\
11531166 TEST_METHOD (DrvFsSmb) \
11541167 { \
11551168 WSL2_TEST_ONLY (); \
1156- DrvFsTests::DrvFsSmb (); \
1169+ DrvFsTests::DrvFsSmb (DrvFsMode::##_mode## ); \
11571170 } \
11581171\
11591172 TEST_METHOD (DrvFsMetadata) \
@@ -1195,7 +1208,7 @@ class WSL1 : public DrvFsTests
11951208 TEST_METHOD (DrvFsReFs) \
11961209 { \
11971210 WSL2_TEST_ONLY (); \
1198- DrvFsTests::DrvFsReFs (); \
1211+ DrvFsTests::DrvFsReFs (DrvFsMode::##_mode## ); \
11991212 } \
12001213 }
12011214
0 commit comments