Skip to content
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

Fix & enable LUKS tests #1013

Merged
merged 1 commit into from
Oct 13, 2023
Merged

Conversation

jikortus
Copy link
Contributor

The code copying RESULT file out of encrypted partitionings has been amended/fixed, so the LUKS tests work OK now.

The way guestfish is handled to do this task is somewhat cumbersome, but I couldn't find with a better solution. guestfish is not able to autodetect the partitioning and open/mount the LUKS container, so a series of explicit commands is needed to do so. I tried to combine this approach with --keys-from-stdin or --key 🔑passphrase, but neither option worked for me.

As I have only fairly limited experience with guestfish so far, I'm not able to tell whether my assumption on how to use the parameters is wrong, whether the options collide with 'manually' entering the commands, or this is a bug. If the latter is the case, I can create a BZ against libguestfs to cover this.

@jikortus jikortus requested a review from rvykydal October 11, 2023 09:51
@rvykydal rvykydal self-assigned this Oct 11, 2023
# Ignore unused variable parsed out by tooling scripts as test tags metadata
# shellcheck disable=SC2034
TESTTYPE="skip-on-rhel storage partition luks"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

part-luks-* are failing for me for rhel, (I've just run them locally on rhel9 and all failed with RESULT not found). That is why I enabled them only on Fedora. Are they stable for you? I wonder if it can be just my environment (even though the tests are run in container)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to work fine for me:

$ ./containers/runner/launch part-luks-1 -p rhel9
...

TEST                                                    | RESULT     | EXPLANATION
--------------------------------------------------------+------------+-------------------------------------------
part-luks-1                                             | SUCCESS    | 

===================================================================================================================================
Test suite for kickstart tests summary:
===================================================================================================================================
# TOTAL:      1
# PASS:       1
# FAILED:     0
# TIMED OUT:  0
===================================================================================================================================


+ exit 0
$ file data/images/boot.iso 
data/images/boot.iso: ISO 9660 CD-ROM filesystem data (DOS/MBR boot sector) 'RHEL-9-3-0-BaseOS-x86_64' (bootable)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I've just realized that my kstest runner container is 17 months (!) old. Let me try with something more recent :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, it works with current container!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So let's enable the tests and see. If they show up unstable again, we can disable them. I won't do any harm.

md_device=$(run_with_timeout ${COPY_FROM_IMAGE_TIMEOUT} "guestfish --ro ${disks} launch : list-md-devices" 2>&1)
md_devices_count=$(wc -l <<< ${md_device})
if [ ${md_devices_count} -ne 1 ]; then
echo "Only 1 RAID device supported by encrypted_file_encrypted_raid()" > ${dir}/RESULT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be useful to report what devices were found.

Copy link
Contributor

@rvykydal rvykydal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you!

@jikortus
Copy link
Contributor Author

@jstodola I'm not sure if such a message would be visible in the test output. However, I just noticed I forgot there two debug messages which I should likely get rid of.

@jikortus jikortus force-pushed the reenable-luks-tests branch from 880ebb8 to f9dc169 Compare October 12, 2023 13:19
This fixes the issue with copying out the RESULT file
from encrypted partitionings properly and reenables
the LUKS tests.
@jikortus jikortus force-pushed the reenable-luks-tests branch from f9dc169 to c96d7e3 Compare October 12, 2023 15:06
@jikortus
Copy link
Contributor Author

OK, now after a discussion with @jstodola, I found out I originally misunderstood his comment, which is obvious to me now that I looked clearer where it was located. I fixed the related piece of code to output the MD devices found to RESULT file if more or less than 1 device is detected.

Copy link
Contributor

@jstodola jstodola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me, thanks!

@rvykydal rvykydal merged commit 74a396a into rhinstaller:master Oct 13, 2023
3 checks passed
@jikortus jikortus deleted the reenable-luks-tests branch October 17, 2023 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants