Bug 330107

Summary: testtrash.cpp: use a more common directory for the test
Product: [Frameworks and Libraries] frameworks-kio Reporter: Lisandro Damián Nicanor Pérez Meyer <perezmeyer>
Component: TrashAssignee: David Faure <faure>
Status: RESOLVED NOT A BUG    
Severity: normal CC: kdelibs-bugs, nate
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed In:

Description Lisandro Damián Nicanor Pérez Meyer 2014-01-18 01:05:06 UTC
./kioslave/trash/tests/testtrash.cpp::859 and 860 use /etc/cups to try to move stuff. This will actually require to install cups to do the test.  Changing this to /etc/cron.d will solve this issue without requiring installing cups. This path is at least present in Red Hat and Debian.


Description: use a path that's always there
 To try to use /etc/cups/ it will require to install cups first. But to be
 able to achieve the same result one can simply use /etc/crond.d, which
 is present both in Debian and Red Hat almost always (if not always).
Author: Lisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>
Forwarded: no
Last-Update: 2014-01-17

--- kde-runtime-4.11.5.orig/kioslave/trash/tests/testtrash.cpp
+++ kde-runtime-4.11.5/kioslave/trash/tests/testtrash.cpp
@@ -856,8 +856,8 @@ void TestTrash::moveDirectoryFromTrash()
 void TestTrash::trashDirectoryOwnedByRoot()
 {
     KUrl u;
-    if ( QFile::exists( "/etc/cups" ) )
-        u.setPath( "/etc/cups" );
+    if ( QFile::exists( "/etc/cron.d" ) )
+        u.setPath( "/etc/cron.d" );
     else if ( QFile::exists( "/boot" ) )
         u.setPath( "/boot" );
     else


Reproducible: Always
Comment 1 Nate Graham 2018-04-16 23:07:26 UTC
As you can see in the code, if /etc/cups isn't there, it falls back to /boot and finally /etc. So there's really no reason to change the first path it looks for to /etc/cron.d.