Skip to content

Commit 5de4ccd

Browse files
Merge pull request #1411 from vojtechtrefny/main_isicsi-startup
tests: Make sure iscsi-init.service is started for iSCSI tests
2 parents 600140d + a52d4ee commit 5de4ccd

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

misc/blivet-tasks.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
- stratisd
5252
- stratis-cli
5353
- libblockdev-tools
54+
- udisks2-iscsi
5455
when: ansible_distribution == 'Fedora' and test_dependencies|bool
5556

5657
####### CentOS 9/10
@@ -99,6 +100,7 @@
99100
- stratisd
100101
- stratis-cli
101102
- libblockdev-tools
103+
- udisks2-iscsi
102104
when: ansible_distribution == 'CentOS' and test_dependencies|bool
103105

104106
- name: Install additional test dependencies (CentOS 9)

plans/tests.fmf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ prepare:
2525
execute:
2626
how: tmt
2727
script:
28-
- sudo python3 tests/run_tests.py -l
28+
- sudo python3 tests/run_tests.py -l -j
2929
- tmt-file-submit -l /tmp/blivet.log

tests/run_tests.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,16 @@ def addFailure(self, test, err): # pylint: disable=redefined-outer-name
228228
argparser.add_argument("-d", "--log-dir", dest="logdir",
229229
help="directory for saving the logs (defaults to /tmp)",
230230
action="store")
231+
argparser.add_argument("-j", "--jenkins", dest="jenkins",
232+
help="run also tests that should run only in a CI environment",
233+
action="store_true")
231234
args = argparser.parse_args()
232235

233236
testdir = os.path.abspath(os.path.dirname(__file__))
234237

238+
if args.jenkins:
239+
os.environ["JENKINS_HOME"] = testdir # pylint: disable=environment-modify
240+
235241
import blivet
236242
print("Running tests with Blivet %s from %s" % (blivet.__version__,
237243
os.path.abspath(os.path.dirname(blivet.__file__))),

tests/storage_tests/iscsi_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ def setUp(self):
112112
except RuntimeError as e:
113113
raise RuntimeError("Failed to setup targetcli device for testing: %s" % e)
114114

115+
subprocess.call(["systemctl", "start", "iscsi-init.service"], stdout=subprocess.DEVNULL)
116+
115117
def _force_logout(self):
116118
subprocess.call(["iscsiadm", "--mode", "node", "--logout", "--name", self.dev], stdout=subprocess.DEVNULL)
117119

0 commit comments

Comments
 (0)