Bug 330107 - testtrash.cpp: use a more common directory for the test
Summary: testtrash.cpp: use a more common directory for the test
Status: RESOLVED NOT A BUG
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Trash (show other bugs)
Version: unspecified
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-18 01:05 UTC by Lisandro Damián Nicanor Pérez Meyer
Modified: 2018-04-16 23:07 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.