Make test suite work better when the temp directory is on NFS.
Deleting directories is one of the great unsolved problems of CS, thanks to abominations like NFS lock files and Windows and races with other processes cleaning up after themselves in the background. The gpg test harness sometimes failed to delete its temp directory on NFS. Avoid the problem class by not deleting it at all, and putting it inside the tmp repo being tested. The test suite's more robust (and/or nonsensical) workarounds for deleting its test dir will thus be used, hopefully avoiding the problem until an OS finds a new way to violate POSIX and the laws of nature. Note that this means that the .gnupg directory will be on whatever filesystem the test suite is being run on, which may be a lesser quality filesystem than gpg is really expecting. Gpg does not seem to need to write sockets etc to there so this seems ok. The only known problem is that if the filesystem forces a directory mode like 777, gpg will warn about unsafe home directory perms, but it still works.
This commit is contained in:
parent
29b3d71122
commit
14971414dc
4 changed files with 30 additions and 22 deletions
8
Test.hs
8
Test.hs
|
@ -60,6 +60,7 @@ import qualified Annex.WorkTree
|
|||
import qualified Annex.Init
|
||||
import qualified Annex.CatFile
|
||||
import qualified Annex.Path
|
||||
import qualified Annex.Perms
|
||||
import qualified Annex.VectorClock
|
||||
import qualified Annex.View
|
||||
import qualified Annex.View.ViewedFile
|
||||
|
@ -1620,9 +1621,12 @@ test_crypto = do
|
|||
where
|
||||
gpgcmd = Utility.Gpg.mkGpgCmd Nothing
|
||||
testscheme scheme = intmpclonerepo $ whenM (Utility.Path.inPath (Utility.Gpg.unGpgCmd gpgcmd)) $ do
|
||||
Utility.Gpg.testTestHarness gpgcmd
|
||||
gpgtmpdir <- annexeval $ (</> "gpgtest")
|
||||
<$> Annex.fromRepo Annex.Locations.gitAnnexTmpMiscDir
|
||||
annexeval $ Annex.Perms.createAnnexDirectory gpgtmpdir
|
||||
Utility.Gpg.testTestHarness gpgtmpdir gpgcmd
|
||||
@? "test harness self-test failed"
|
||||
Utility.Gpg.testHarness gpgcmd $ do
|
||||
Utility.Gpg.testHarness gpgtmpdir gpgcmd $ do
|
||||
createDirectory "dir"
|
||||
let a cmd = git_annex cmd $
|
||||
[ "foo"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue