[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/9] tests/avocado/virtiofs_submounts.py: shared_dir may not exis
From: |
Cleber Rosa |
Subject: |
[PATCH 6/9] tests/avocado/virtiofs_submounts.py: shared_dir may not exist |
Date: |
Fri, 25 Feb 2022 16:01:53 -0500 |
If the test is skipped because of their conditionals, the shared_dir
attribute may not exist.
Check for its existence in the tearDown() method to avoid and
AttributeError.
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
tests/avocado/virtiofs_submounts.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tests/avocado/virtiofs_submounts.py
b/tests/avocado/virtiofs_submounts.py
index e6dc32ffd4..d9c2c9d9ef 100644
--- a/tests/avocado/virtiofs_submounts.py
+++ b/tests/avocado/virtiofs_submounts.py
@@ -157,9 +157,10 @@ def tearDown(self):
except:
pass
- scratch_dir = os.path.join(self.shared_dir, 'scratch')
- self.run(('bash', self.get_data('cleanup.sh'), scratch_dir),
- ignore_error=True)
+ if hasattr(self, 'shared_dir'):
+ scratch_dir = os.path.join(self.shared_dir, 'scratch')
+ self.run(('bash', self.get_data('cleanup.sh'), scratch_dir),
+ ignore_error=True)
def test_pre_virtiofsd_set_up(self):
self.set_up_shared_dir()
--
2.35.1
- Re: [PATCH 2/9] Avocado tests: use logging namespace that is preserved in test logs, (continued)
- [PATCH 3/9] Avocado migration test: adapt to "utils.network" API namespace change, Cleber Rosa, 2022/02/25
- [PATCH 4/9] Avocado: bump to version 95.0, Cleber Rosa, 2022/02/25
- [PATCH 5/9] tests/avocado/linux_ssh_mips_malta.py: add missing accel (tcg) tag, Cleber Rosa, 2022/02/25
- [PATCH 7/9] Avocado tests: improve documentation on tag filtering, Cleber Rosa, 2022/02/25
- [PATCH 6/9] tests/avocado/virtiofs_submounts.py: shared_dir may not exist,
Cleber Rosa <=
- [PATCH 9/9] Avocado tests: don't run tests with TCG that boot full blown distros, Cleber Rosa, 2022/02/25
- [PATCH 8/9] Avocado tests: classify tests based on what it's booted, Cleber Rosa, 2022/02/25