Blame tests/dirinstall/dirinstall.sh
|
Radek Vykydal |
ffec79 |
#!/bin/sh -eux
|
|
Radek Vykydal |
ffec79 |
|
|
Radek Vykydal |
ffec79 |
|
|
Radek Vykydal |
ffec79 |
# Prepare test work directory
|
|
Radek Vykydal |
ffec79 |
|
|
Radek Vykydal |
ffec79 |
WORK_DIR=$(mktemp -d /var/tmp/dirinstall.XXXXXX)
|
|
Radek Vykydal |
ffec79 |
|
|
Radek Vykydal |
ffec79 |
|
|
Radek Vykydal |
ffec79 |
# Create kickstart
|
|
Radek Vykydal |
ffec79 |
|
|
Radek Vykydal |
ffec79 |
KICKSTART_PATH=${WORK_DIR}/ks.cfg
|
|
Jiri Konecny |
77bc5c |
. ./repositories
|
|
Radek Vykydal |
ffec79 |
TEST_KICKSTART=./ks.dirinstall.cfg
|
|
Radek Vykydal |
ffec79 |
|
|
Jiri Konecny |
77bc5c |
echo "==== List of repositories ===="
|
|
Jiri Konecny |
77bc5c |
dnf repoinfo
|
|
Jiri Konecny |
77bc5c |
echo "== End list of repositories =="
|
|
Jiri Konecny |
77bc5c |
|
|
Jiri Konecny |
77bc5c |
if grep -q 'NAME="CentOS Stream"' /etc/os-release ; then
|
|
Jiri Konecny |
77bc5c |
BASE_REPO="$STREAM_BASE_REPO"
|
|
Jiri Konecny |
77bc5c |
APP_REPO="$STREAM_APP_REPO"
|
|
Jiri Konecny |
77bc5c |
else
|
|
Jiri Konecny |
77bc5c |
BASE_REPO="$RHEL_BASE_REPO"
|
|
Jiri Konecny |
77bc5c |
APP_REPO="$RHEL_APP_REPO"
|
|
Jiri Konecny |
77bc5c |
fi
|
|
Jiri Konecny |
77bc5c |
|
|
Jiri Konecny |
77bc5c |
get_base_url () {
|
|
Jiri Konecny |
77bc5c |
REPO="$1"
|
|
Jiri Konecny |
77bc5c |
|
|
Jiri Konecny |
77bc5c |
# This will show repository content and get url from this:
|
|
Jiri Konecny |
77bc5c |
# Repo-baseurl : http://ftp.sh.cvut.cz/centos-stream/9-stream/BaseOS/x86_64/os/ (51 more)
|
|
Jiri Konecny |
77bc5c |
dnf repoinfo "$REPO" | \
|
|
Jiri Konecny |
77bc5c |
grep ^Repo-baseurl | \
|
|
Jiri Konecny |
77bc5c |
cut -d: -f2- | \
|
|
Jiri Konecny |
77bc5c |
sed 's/^ *//' | \
|
|
Jiri Konecny |
77bc5c |
cut -d' ' -f1
|
|
Jiri Konecny |
77bc5c |
}
|
|
Jiri Konecny |
77bc5c |
|
|
Radek Vykydal |
ffec79 |
# Dump URLs of installation repositories found in local repositories whose names are configured in 'repositories' file
|
|
Jiri Konecny |
77bc5c |
echo "url --url=$(get_base_url $BASE_REPO)" > ${KICKSTART_PATH}
|
|
Jiri Konecny |
77bc5c |
echo "repo --name=$APP_REPO --baseurl=$(get_base_url $APP_REPO)" >> ${KICKSTART_PATH}
|
|
Radek Vykydal |
ffec79 |
|
|
Radek Vykydal |
ffec79 |
cat ${TEST_KICKSTART} >> ${KICKSTART_PATH}
|
|
Radek Vykydal |
ffec79 |
|
|
Radek Vykydal |
ffec79 |
# Log the kickstart
|
|
Radek Vykydal |
ffec79 |
cat ${KICKSTART_PATH}
|
|
Radek Vykydal |
ffec79 |
|
|
Radek Vykydal |
ffec79 |
|
|
Radek Vykydal |
ffec79 |
# Run dirinstall
|
|
Radek Vykydal |
ffec79 |
|
|
Radek Vykydal |
ffec79 |
INSTALL_DIR=${WORK_DIR}/install_dir
|
|
Radek Vykydal |
ffec79 |
mkdir ${INSTALL_DIR}
|
|
Radek Vykydal |
ffec79 |
|
|
Radek Vykydal |
ffec79 |
anaconda --dirinstall ${INSTALL_DIR} --kickstart ${KICKSTART_PATH} --${ANACONDA_UI_MODE} --noninteractive 2>&1
|
|
Radek Vykydal |
ffec79 |
|
|
Radek Vykydal |
ffec79 |
|
|
Radek Vykydal |
ffec79 |
# Remove test work directory
|
|
Radek Vykydal |
ffec79 |
|
|
Radek Vykydal |
ffec79 |
rm -rf ${WORK_DIR}
|
|
Radek Vykydal |
ffec79 |
|
|
Radek Vykydal |
ffec79 |
|
|
Radek Vykydal |
ffec79 |
# Show and remove the logs for this anaconda run
|
|
Radek Vykydal |
ffec79 |
|
|
Radek Vykydal |
ffec79 |
./show_logs.sh
|