summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2022-06-19 19:41:00 -0700
committerArmin Kuster <akuster808@gmail.com>2022-06-23 18:47:59 -0700
commitb5642c519b90f83ab6ec1507db9b3b36db43c548 (patch)
treee406af617cceb55b562b85de455dbdb356ee5200
parentfccbe155be6b3a62cc565861114274f3fd72c564 (diff)
downloadmeta-security-b5642c519b90f83ab6ec1507db9b3b36db43c548.tar.gz
oeqa: meta-tpm shut swtpm down before and after testing
fixes: swtpm: Could not open TCP socket: Address already in use Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-tpm/lib/oeqa/runtime/cases/swtpm.py2
-rw-r--r--meta-tpm/lib/oeqa/runtime/cases/tpm2.py2
2 files changed, 4 insertions, 0 deletions
diff --git a/meta-tpm/lib/oeqa/runtime/cases/swtpm.py b/meta-tpm/lib/oeqa/runtime/cases/swtpm.py
index df47b35..0be5c59 100644
--- a/meta-tpm/lib/oeqa/runtime/cases/swtpm.py
+++ b/meta-tpm/lib/oeqa/runtime/cases/swtpm.py
@@ -8,11 +8,13 @@ from oeqa.core.decorator.data import skipIfNotFeature
8class SwTpmTest(OERuntimeTestCase): 8class SwTpmTest(OERuntimeTestCase):
9 @classmethod 9 @classmethod
10 def setUpClass(cls): 10 def setUpClass(cls):
11 cls.tc.target.run('swtpm_ioctl -s --tcp :2322')
11 cls.tc.target.run('mkdir /tmp/myvtpm2') 12 cls.tc.target.run('mkdir /tmp/myvtpm2')
12 cls.tc.target.run('chown tss:root /tmp/myvtpm2') 13 cls.tc.target.run('chown tss:root /tmp/myvtpm2')
13 14
14 @classmethod 15 @classmethod
15 def tearDownClass(cls): 16 def tearDownClass(cls):
17 cls.tc.target.run('swtpm_ioctl -s --tcp :2322')
16 cls.tc.target.run('rm -fr /tmp/myvtpm2') 18 cls.tc.target.run('rm -fr /tmp/myvtpm2')
17 19
18 @skipIfNotFeature('tpm2','Test tpm2_swtpm_socket requires tpm2 to be in DISTRO_FEATURES') 20 @skipIfNotFeature('tpm2','Test tpm2_swtpm_socket requires tpm2 to be in DISTRO_FEATURES')
diff --git a/meta-tpm/lib/oeqa/runtime/cases/tpm2.py b/meta-tpm/lib/oeqa/runtime/cases/tpm2.py
index e64d19d..8e90dc9 100644
--- a/meta-tpm/lib/oeqa/runtime/cases/tpm2.py
+++ b/meta-tpm/lib/oeqa/runtime/cases/tpm2.py
@@ -8,10 +8,12 @@ from oeqa.core.decorator.data import skipIfNotFeature
8class Tpm2Test(OERuntimeTestCase): 8class Tpm2Test(OERuntimeTestCase):
9 @classmethod 9 @classmethod
10 def setUpClass(cls): 10 def setUpClass(cls):
11 cls.tc.target.run('swtpm_ioctl -s --tcp :2322')
11 cls.tc.target.run('mkdir /tmp/myvtpm2') 12 cls.tc.target.run('mkdir /tmp/myvtpm2')
12 13
13 @classmethod 14 @classmethod
14 def tearDownClass(cls): 15 def tearDownClass(cls):
16 cls.tc.target.run('swtpm_ioctl -s --tcp :2322')
15 cls.tc.target.run('rm -fr /tmp/myvtpm2') 17 cls.tc.target.run('rm -fr /tmp/myvtpm2')
16 18
17 def check_endlines(self, results, expected_endlines): 19 def check_endlines(self, results, expected_endlines):