Remove directories after the OverlayFs test completes (#13085)

Blue committed Jun 11, 2025 at 13:40 UTC 71daaef7bb072a203c818549544a61f1e21ac628
1 file changed +12
test/linux/unit_tests/overlayfs.c
+12
@@ -170,6 +170,18 @@ int OverlayFsTestEntry(int Argc, char* Argv[])
170 LxtCheckResult(LxtRunVariations(&Args, g_LxtVariations, LXT_COUNT_OF(g_LxtVariations)));
171
172 ErrorExit:
173 +
174 + char DeleteCmd[128];
175 +
176 + for (int Index = 0; Index < LXT_COUNT_OF(g_OvFsTestDirs); ++Index)
177 + {
178 + sprintf(DeleteCmd, "rm -rf %s", g_OvFsTestDirs[Index]);
179 + if (system(DeleteCmd) < 0)
180 + {
181 + LxtLogError("Failed to delete %s", g_OvFsTestDirs[Index]);
182 + }
183 + }
184 +
185 LxtUninitialize();
186 return !LXT_SUCCESS(Result);
187 }