From 8b8911ddc032514f709ba2a8b2b2002afda11406 Mon Sep 17 00:00:00 2001 From: Samuel Moors Date: Sun, 24 Nov 2024 17:17:32 +0100 Subject: [PATCH] add sanity check --- eessi/testsuite/eessi_staging.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/eessi/testsuite/eessi_staging.py b/eessi/testsuite/eessi_staging.py index d97ba9ea..8e05b892 100644 --- a/eessi/testsuite/eessi_staging.py +++ b/eessi/testsuite/eessi_staging.py @@ -1,5 +1,8 @@ +from pathlib import Path + import reframe as rfm from reframe.utility import sanity as sn +from reframe.core.builtins import run_after, sanity_function @rfm.simple_test @@ -10,4 +13,20 @@ class EESSI_Staging(rfm.RunOnlyRegressionTest): valid_prog_environs = ['*'] executable = "true" local = True - sanity_patterns = sn.assert_true(True) + + @run_after('init') + def remove_modules(self): + self.modules = [] + + @sanity_function + def check_stagedir(self): + ignore = {'rfm_job.sh', 'rfm_job.out', 'rfm_job.err'} + sourcepath = Path(self.sourcesdir) + sourcefiles = {x.relative_to(sourcepath).as_posix() for x in sourcepath.rglob('*')} + stagepath = Path(self.stagedir) + stagefiles = {x.relative_to(stagepath).as_posix() for x in stagepath.rglob('*')} - ignore + + return sn.assert_eq( + sourcefiles, stagefiles, + f'sourcesdir {self.sourcesdir} and stagedir {self.stagedir} do not have the same contents' + )