Migrate to TMT-style gating in C9S
This is required for RHIVOS, see VROOM-23635.
This commit is contained in:
parent
912a29239b
commit
550e8d1e90
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
|||||||
|
1
|
2
ci.fmf
Normal file
2
ci.fmf
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Docs: https://docs.fedoraproject.org/en-US/ci/tmt/#_multiple_plans
|
||||||
|
resultsdb-testcase: separate
|
@ -1,6 +1,6 @@
|
|||||||
--- !Policy
|
--- !Policy
|
||||||
product_versions:
|
product_versions:
|
||||||
- rhel-9
|
- rhel-*
|
||||||
decision_context: osci_compose_gate
|
decision_context: osci_compose_gate
|
||||||
rules:
|
rules:
|
||||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
|
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/tier1-internal.functional}
|
||||||
|
10
plans.fmf
Normal file
10
plans.fmf
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/tier1-internal:
|
||||||
|
discover:
|
||||||
|
how: fmf
|
||||||
|
url: https://pkgs.devel.redhat.com/git/tests/dracut
|
||||||
|
filter: 'tier: 1'
|
||||||
|
execute:
|
||||||
|
how: tmt
|
||||||
|
adjust:
|
||||||
|
enabled: false
|
||||||
|
when: distro == centos-stream or distro == fedora
|
@ -1,52 +0,0 @@
|
|||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
#
|
|
||||||
# Makefile of /dracut/add-luks-keys
|
|
||||||
# Description: Create and add a luks key to all luks devices to allow booting of a system without entering a passphrase
|
|
||||||
# Author: Jan Stodola <jstodola@redhat.com>
|
|
||||||
#
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
#
|
|
||||||
# Copyright (c) 2016 Red Hat, Inc. All rights reserved.
|
|
||||||
# Red Hat Internal
|
|
||||||
#
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
export TEST=/dracut/add-luks-keys
|
|
||||||
export TESTVERSION=1.0
|
|
||||||
export DESCRIPTION="Create and add a luks key to all luks devices to allow booting of a system without entering a passphrase"
|
|
||||||
|
|
||||||
BUILT_FILES=
|
|
||||||
|
|
||||||
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
|
||||||
|
|
||||||
.PHONY: all install download clean
|
|
||||||
|
|
||||||
run: $(FILES) build
|
|
||||||
./runtest.sh
|
|
||||||
|
|
||||||
build: $(BUILT_FILES)
|
|
||||||
test -x runtest.sh || chmod a+x runtest.sh
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *~ $(BUILT_FILES)
|
|
||||||
|
|
||||||
|
|
||||||
include /usr/share/rhts/lib/rhts-make.include
|
|
||||||
|
|
||||||
$(METADATA): Makefile
|
|
||||||
@echo "Owner: Jan Stodola <jstodola@redhat.com>" > $(METADATA)
|
|
||||||
@echo "Name: $(TEST)" >> $(METADATA)
|
|
||||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
|
||||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
|
||||||
@echo "Description: $(DESCRIPTION)" >> $(METADATA)
|
|
||||||
@echo "Type: Install" >> $(METADATA)
|
|
||||||
@echo "TestTime: 10m" >> $(METADATA)
|
|
||||||
@echo "RunFor: dracut" >> $(METADATA)
|
|
||||||
@echo "Requires: dracut" >> $(METADATA)
|
|
||||||
@echo "Priority: Normal" >> $(METADATA)
|
|
||||||
@echo "License: Red Hat Internal" >> $(METADATA)
|
|
||||||
@echo "Confidential: no" >> $(METADATA)
|
|
||||||
@echo "Destructive: no" >> $(METADATA)
|
|
||||||
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
|
|
||||||
|
|
||||||
rhts-lint $(METADATA)
|
|
@ -1,3 +0,0 @@
|
|||||||
PURPOSE of /dracut/add-luks-keys
|
|
||||||
Description: Create and add a luks key to all luks devices to allow booting of a system without entering a passphrase.
|
|
||||||
Author: Jan Stodola <jstodola@redhat.com>
|
|
@ -1,59 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
#
|
|
||||||
# runtest.sh of /dracut/add-luks-keys
|
|
||||||
# Description: Create and add a luks key to all luks devices to allow booting of a system without entering a passphrase
|
|
||||||
# Author: Jan Stodola <jstodola@redhat.com>
|
|
||||||
#
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
#
|
|
||||||
# Copyright (c) 2016 Red Hat, Inc. All rights reserved.
|
|
||||||
# Red Hat Internal
|
|
||||||
#
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
# Include Beaker environment
|
|
||||||
. /usr/bin/rhts-environment.sh || exit 1
|
|
||||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
|
||||||
|
|
||||||
PACKAGE="dracut"
|
|
||||||
|
|
||||||
keyfile="/root/keyfile"
|
|
||||||
kernel_file=`grubby --default-kernel`
|
|
||||||
initrd_file=`grubby --info=$kernel_file | grep ^initrd= | sed 's/^initrd=//' | head -n1`
|
|
||||||
kernel_version=`rpm -qf $kernel_file --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n'`
|
|
||||||
|
|
||||||
rlJournalStart
|
|
||||||
rlPhaseStartTest "Add luks keys to initramfs"
|
|
||||||
|
|
||||||
if [ ! -e "$keyfile" ]; then
|
|
||||||
rlLog "Creating new key file: $keyfile"
|
|
||||||
rlRun "dd if=/dev/urandom bs=1 count=32 of=$keyfile"
|
|
||||||
rlRun "chmod 0400 $keyfile"
|
|
||||||
else
|
|
||||||
rlLog "Using existing key file: $keyfile"
|
|
||||||
fi
|
|
||||||
|
|
||||||
rlAssertExists "/etc/crypttab"
|
|
||||||
rlFileSubmit "/etc/crypttab"
|
|
||||||
UUIDS=`cat /etc/crypttab | cut -d' ' -f2 | cut -d'=' -f2`
|
|
||||||
for UUID in $UUIDS; do
|
|
||||||
rlRun "echo 'redhat' | /sbin/cryptsetup luksAddKey /dev/disk/by-uuid/$UUID $keyfile"
|
|
||||||
done;
|
|
||||||
|
|
||||||
# modify /etc/crypttab, set key file in the thirth column of the file
|
|
||||||
rlRun "awk -v \"KEY_FILE=$keyfile\" '{\$3=KEY_FILE; print \$0}' /etc/crypttab > crypttab_mod"
|
|
||||||
rlRun "mv -Z crypttab_mod /etc/crypttab"
|
|
||||||
rlRun "chmod 0600 /etc/crypttab"
|
|
||||||
|
|
||||||
rlRun "dracut -f -I $keyfile $initrd_file $kernel_version"
|
|
||||||
|
|
||||||
# zipl has to be executed on s390x
|
|
||||||
if [ -x /sbin/zipl ]; then
|
|
||||||
rlRun "/sbin/zipl"
|
|
||||||
fi
|
|
||||||
|
|
||||||
rlPhaseEnd
|
|
||||||
rlJournalEnd
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
# This first play always runs on the local staging system
|
|
||||||
- hosts: localhost
|
|
||||||
roles:
|
|
||||||
- role: standard-test-beakerlib
|
|
||||||
tags:
|
|
||||||
- classic
|
|
||||||
tests:
|
|
||||||
- add-luks-keys
|
|
||||||
required_packages:
|
|
||||||
- dracut # Required for add-luks-keys
|
|
Loading…
Reference in New Issue
Block a user