-
Notifications
You must be signed in to change notification settings - Fork 39
iscsi: replace host targetcli with VM-based iSCSI target #1660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
bruno-fs
wants to merge
8
commits into
rhinstaller:main
Choose a base branch
from
bruno-fs:iscsi-4044
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1cb4610
iscsi: replace host targetcli with VM-based iSCSI target
bruno-fs 9094878
iscsi: address QE review findings
bruno-fs bf8e718
iscsi: fail fast when sshpass is not installed
bruno-fs c364390
Revert "iscsi: fail fast when sshpass is not installed"
bruno-fs 61010dc
iscsi: add comments explaining kickstart and function changes
bruno-fs 5ab6b8d
iscsi: address PR review comments
bruno-fs ac0acc1
iscsi: DRY the prepare() function across test scripts
bruno-fs 88192bf
iscsi: use jq instead of python3 for cloud image URL resolution
bruno-fs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
|
|
||
| %ksappend repos/default.ks | ||
|
|
||
| # INSTALLER-4044 reproducer: ignoredisk BEFORE iscsi | ||
| # On unfixed builds, this fails with "Disk sda does not exist" | ||
| # On fixed builds (deferred device resolution), this works | ||
| ignoredisk --only-use=@KSTEST_ISCSI_DISK@ | ||
|
|
||
| iscsiname @KSTEST_ISCSINAME@ | ||
| iscsi --ipaddr @KSTEST_ISCSI_IP@ --port @KSTEST_ISCSI_PORT@ --target @KSTEST_ISCSI_TARGET@ | ||
|
|
||
| bootloader --location=none | ||
| zerombr | ||
| clearpart --all | ||
| autopart --nohome | ||
|
|
||
| keyboard us | ||
| lang en | ||
| timezone America/New_York | ||
| rootpw qweqwe | ||
| poweroff | ||
|
|
||
| %packages | ||
| %end | ||
|
|
||
| %post --nochroot | ||
|
|
||
| SYSROOT=/mnt/sysroot | ||
|
|
||
| function check_iscsi_session_nochroot() { | ||
| local transport="$1" | ||
| local target="$2" | ||
|
|
||
| iscsiadm -m session | grep -Eq '^'${transport}':.*'${target} | ||
| if [[ $? -ne 0 ]]; then | ||
| echo "*** Failed check: ${target} session using ${transport} exists" >> $SYSROOT/root/RESULT | ||
| fi | ||
| } | ||
|
|
||
| check_iscsi_session_nochroot tcp @KSTEST_ISCSI_TARGET@ | ||
|
|
||
| %end | ||
|
|
||
| %post | ||
| # No error was written to /root/RESULT file, everything is OK | ||
| if [[ ! -e /root/RESULT ]]; then | ||
| echo SUCCESS > /root/RESULT | ||
| fi | ||
| %end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # | ||
| # Copyright (C) 2025 Red Hat, Inc. | ||
| # | ||
| # This copyrighted material is made available to anyone wishing to use, | ||
| # modify, copy, or redistribute it subject to the terms and conditions of | ||
| # the GNU General Public License v.2, or (at your option) any later version. | ||
| # This program is distributed in the hope that it will be useful, but WITHOUT | ||
| # ANY WARRANTY expressed or implied, including the implied warranties of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
| # Public License for more details. You should have received a copy of the | ||
| # GNU General Public License along with this program; if not, write to the | ||
| # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
| # 02110-1301, USA. Any Red Hat trademarks that are incorporated in the | ||
| # source code or documentation are not subject to the GNU General Public | ||
| # License and may only be used or replicated with the express permission of | ||
| # Red Hat, Inc. | ||
|
|
||
| # INSTALLER-4044: ignoredisk before iscsi ordering test | ||
| # Requires the anaconda fix that defers device resolution to process_kickstart() | ||
|
|
||
| # Ignore unused variable parsed out by tooling scripts as test tags metadata | ||
| # shellcheck disable=SC2034 | ||
| TESTTYPE=${TESTTYPE:-"iscsi"} | ||
|
|
||
| . ${KSTESTDIR}/iscsi.sh | ||
|
|
||
| prepare() { | ||
| local ks=$1 | ||
| local tmpdir=$2 | ||
|
|
||
| local test_id | ||
| test_id=$(basename "${tmpdir}") | ||
| local lc_test_id | ||
| lc_test_id=$(echo "${test_id,,}" | tr -c 'a-z0-9\n' '-') | ||
| local wwn=iqn.2003-01.kickstart.test:${lc_test_id} | ||
| local initiator=iqn.2009-02.com.example:${lc_test_id} | ||
| local logfile=${tmpdir}/iscsi-target.log | ||
|
|
||
| create_iscsi_target_vm ${wwn} ${initiator} ${tmpdir} ${logfile} || return 1 | ||
|
|
||
| # sda is the expected device name for the first SCSI disk from iSCSI on x86_64 | ||
| sed -i \ | ||
| -e "s#@KSTEST_ISCSI_IP@#10.10.10.1#g" \ | ||
| -e "s#@KSTEST_ISCSI_PORT@#3260#g" \ | ||
| -e "s#@KSTEST_ISCSI_TARGET@#${wwn}#g" \ | ||
| -e "s#@KSTEST_ISCSINAME@#${initiator}#g" \ | ||
| -e "s#@KSTEST_ISCSI_DISK@#sda#g" \ | ||
| ${ks} | ||
|
|
||
| echo ${ks} | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.