From 3000b6b473422dca3670c922c24d0e15e963281a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 16 May 2011 11:08:32 -0500 Subject: pactest: treat symlinks with more respect Don't call os.stat() when we should be using os.lstat(); this allows us to actually test dead symlinks that don't have a corresponding file. Add a new LINK_EXIST rule that complements FILE_EXIST for a similar purpose. Signed-off-by: Dan McGee --- test/pacman/pmrule.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/pacman/pmrule.py') diff --git a/test/pacman/pmrule.py b/test/pacman/pmrule.py index c68d085e..0f6ae602 100755 --- a/test/pacman/pmrule.py +++ b/test/pacman/pmrule.py @@ -146,6 +146,14 @@ class pmrule(object): else: print "FILE rule '%s' not found" % case success = -1 + elif kind == "LINK": + filename = os.path.join(test.root, key) + if case == "EXIST": + if not os.path.islink(filename): + success = 0 + else: + print "LINK rule '%s' not found" % case + success = -1 elif kind == "CACHE": cachedir = os.path.join(test.root, util.PM_CACHEDIR) if case == "EXISTS": -- cgit v1.2.3