[pacman-dev] [PATCH 1/5] valgrind.supp: add fakeroot/fakechroot errors
Signed-off-by: Andrew Gregory
This will allow us to detect whether valgrind found any errors while
still preserving pacman's return code for tests.
Signed-off-by: Andrew Gregory
Let valgrind do the work of writing any suppression rules needed by the
test suite.
Signed-off-by: Andrew Gregory
On Mon, Jan 6, 2014 at 2:19 PM, Andrew Gregory
Let valgrind do the work of writing any suppression rules needed by the test suite.
Signed-off-by: Andrew Gregory
---
This makes sense. It just makes it a heck of a lot easier to get the
possible suppression into the file, but it doesn't actually write it out
for you.
Signed-off-by: Dan McGee
1 file changed, 1 insertion(+)
diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py index e5094a1..1c3ea7c 100644 --- a/test/pacman/pmtest.py +++ b/test/pacman/pmtest.py @@ -220,6 +220,7 @@ def run(self, pacman): cmd.extend(["libtool", "execute", "valgrind", "-q", "--tool=memcheck", "--leak-check=full", "--show-reachable=yes", + "--gen-suppressions=all", "--log-file=%s" % os.path.join(self.root, "var/log/valgrind"), "--suppressions=%s" % suppfile]) cmd.extend([pacman["bin"], -- 1.8.5.2
Silences false warnings after alpm forks to run install scripts.
Signed-off-by: Andrew Gregory
On Mon, Jan 6, 2014 at 2:19 PM, Andrew Gregory
Silences false warnings after alpm forks to run install scripts.
Signed-off-by: Andrew Gregory
---
We didn't actually run install scripts in the test suite before if I remember right, so there was likely no need for this option before. Seems reasonable to add, especially given these forks are short-lived anyway and they can just clean themselves up.
test/pacman/pmtest.py | 1 + 1 file changed, 1 insertion(+)
diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py index 1c3ea7c..e780a6d 100644 --- a/test/pacman/pmtest.py +++ b/test/pacman/pmtest.py @@ -221,6 +221,7 @@ def run(self, pacman): "--tool=memcheck", "--leak-check=full", "--show-reachable=yes", "--gen-suppressions=all", + "--child-silent-after-fork=yes", "--log-file=%s" % os.path.join(self.root, "var/log/valgrind"), "--suppressions=%s" % suppfile]) cmd.extend([pacman["bin"], -- 1.8.5.2
Signed-off-by: Andrew Gregory
On Mon, Jan 6, 2014 at 2:19 PM, Andrew Gregory
Signed-off-by: Andrew Gregory
---
Seems like this is two patches in one- one to add FILE_EMPTY, and one to use it. How does FILE_EMPTY behave in these cases? Namely the first one feels like a gray area that the code does not make super obvious. * File doesn't exist * File exists, is empty * File exists, is not empty * File is a directory Also, don't we document the available rules somewhere?
test/pacman/pmrule.py | 3 +++ test/pacman/pmtest.py | 1 + 2 files changed, 4 insertions(+)
diff --git a/test/pacman/pmrule.py b/test/pacman/pmrule.py index ba94ab8..96ecdec 100644 --- a/test/pacman/pmrule.py +++ b/test/pacman/pmrule.py @@ -112,6 +112,9 @@ def check(self, test): if case == "EXIST": if not os.path.isfile(filename): success = 0 + elif case == "EMPTY": + if not os.path.getsize(filename) == 0: + success = 0 elif case == "MODIFIED": for f in test.files: if f.name == key: diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py index e780a6d..7079b78 100644 --- a/test/pacman/pmtest.py +++ b/test/pacman/pmtest.py @@ -224,6 +224,7 @@ def run(self, pacman): "--child-silent-after-fork=yes", "--log-file=%s" % os.path.join(self.root, "var/log/valgrind"), "--suppressions=%s" % suppfile]) + self.addrule("FILE_EMPTY=var/log/valgrind") cmd.extend([pacman["bin"], "--config", os.path.join(self.root, util.PACCONF), "--root", self.root, -- 1.8.5.2
Succeeds if the specified path is a file and is empty.
Signed-off-by: Andrew Gregory
Signed-off-by: Andrew Gregory
On 04/02/14 03:05, Andrew Gregory wrote:
Signed-off-by: Andrew Gregory
--- test/pacman/README | 5 +++++ test/pacman/pmtest.py | 1 + 2 files changed, 6 insertions(+) diff --git a/test/pacman/README b/test/pacman/README index 2516a8a..8d8354a 100644 --- a/test/pacman/README +++ b/test/pacman/README @@ -62,6 +62,11 @@ This example will run all tests from the "tests" directory. Use the "help" option to get the full list of parameters: ./pactest.py --help
+When run with the `--valgrind' option, an additional rule will be added to all +tests to check for memory leaks. To use `--valgrind' when running the full +test suite, run: + make PY_LOG_FLAGS=--valgrind check + The following pieces of software are required to run the pactest suite:
Awesome! Is this what you are seeing when running the tests with valgrind? # FAIL: 14 FAIL: test/pacman/tests/ignore002 FAIL: test/pacman/tests/ignore003 FAIL: test/pacman/tests/ignore004 FAIL: test/pacman/tests/provision010 FAIL: test/pacman/tests/provision012 FAIL: test/pacman/tests/provision020 FAIL: test/pacman/tests/provision022 FAIL: test/pacman/tests/sync-nodepversion02 FAIL: test/pacman/tests/sync-nodepversion04 FAIL: test/pacman/tests/sync1008 FAIL: test/pacman/tests/sync300 FAIL: test/pacman/tests/upgrade071 FAIL: test/pacman/tests/upgrade075 FAIL: test/pacman/tests/upgrade077 I note this is down from 64 after your export freeing functions patch! Allan
participants (3)
-
Allan McRae
-
Andrew Gregory
-
Dan McGee