Skip to content
42 changes: 36 additions & 6 deletions ci/rpm/test_daos_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ case "$ID_LIKE" in
;;
esac

SERVER_CONFIG="/etc/daos/daos_server.yml"
AGENT_CONFIG="/etc/daos/daos_agent.yml"
CONTROL_CONFIG="/etc/daos/daos_control.yml"

if [ -n "$DAOS_PKG_VERSION" ]; then
DAOS_PKG_VERSION="-${DAOS_PKG_VERSION}"
fi
Expand All @@ -30,6 +34,7 @@ if rpm -q daos-server; then
echo "daos-server RPM should not be installed as a dependency of daos-client"
exit 1
fi

if ! sudo $YUM -y history undo last; then
echo "Error trying to undo previous dnf transaction"
$YUM history
Expand Down Expand Up @@ -82,13 +87,38 @@ if ! sudo $YUM -y history undo last; then
$YUM history
exit 1
fi

# Verify config files my creating an existing config file before installing the RPM
if [ -f "${SERVER_CONFIG}" ]; then
echo "A ${SERVER_CONFIG} config file should not exist before the daos-server install"
ls -al /etc/daos/daos*
exit 1
fi
if [ -f "${AGENT_CONFIG}" ]; then
echo "A ${AGENT_CONFIG} config file should not exist before the daos-client-tests-openmpi install"
ls -al /etc/daos/daos*
exit 1
fi
sudo touch "${SERVER_CONFIG}"
sudo touch "${AGENT_CONFIG}"

sudo $YUM -y install daos-server"$DAOS_PKG_VERSION"
if rpm -q daos-client; then
echo "daos-client RPM should not be installed as a dependency of daos-server"
exit 1
fi
if [ ! -f "${SERVER_CONFIG}.rpmnew" ]; then
echo "A ${SERVER_CONFIG}.rpmnew file should exist after the daos-server install"
ls -al /etc/daos/daos*
exit 1
fi
Comment on lines +110 to +114
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I know I've seen these rpmnew files before but on my local system with latest master RPMs I do not. So I'm guessing this gets handled but the --config-files option?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, when files marked as config files already exist the RPM installs a .rpmnew version of the config file instead of overwriting the file.

The Test RPM script now touches two of the config files before installing the RPMS to test this behavior:

[2026-04-15T19:04:12.871Z] + ls -al /etc/daos/daos_agent.yml /etc/daos/daos_server.yml
[2026-04-15T19:04:12.871Z] -rw-r--r-- 1 root root 0 Apr 15 19:04 /etc/daos/daos_agent.yml
[2026-04-15T19:04:12.871Z] -rw-r--r-- 1 root root 0 Apr 15 19:04 /etc/daos/daos_server.yml
[2026-04-15T19:04:12.871Z] + sudo dnf -y install daos-server

After the install of daos-server and daos-admin with /etc/daos/daos_server.yml and /etc/daos/daos_agent.yml marked as a config file:

[2026-04-15T19:04:26.967Z] + ls -al /etc/daos/daos_agent.yml /etc/daos/daos_agent.yml.rpmnew /etc/daos/daos_control.yml /etc/daos/daos_server.yml /etc/daos/daos_server.yml.rpmnew
[2026-04-15T19:04:26.967Z] -rw-r--r-- 1 root root     0 Apr 15 19:04 /etc/daos/daos_agent.yml
[2026-04-15T19:04:26.967Z] -rw-r--r-- 1 root root  6386 Apr 15 18:48 /etc/daos/daos_agent.yml.rpmnew
[2026-04-15T19:04:26.967Z] -rw-r--r-- 1 root root  1402 Apr 15 18:48 /etc/daos/daos_control.yml
[2026-04-15T19:04:26.967Z] -rw-r--r-- 1 root root     0 Apr 15 19:04 /etc/daos/daos_server.yml
[2026-04-15T19:04:26.967Z] -rw-r--r-- 1 root root 25754 Apr 15 18:47 /etc/daos/daos_server.yml.rpmnew

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks. That makes sense


sudo $YUM -y install --exclude ompi daos-client-tests-openmpi"$DAOS_PKG_VERSION"
if [ ! -f "${AGENT_CONFIG}.rpmnew" ]; then
echo "A ${AGENT_CONFIG}.rpmnew file should exist after the daos-client-tests-openmpi install"
ls -al /etc/daos/daos*
exit 1
fi

me=$(whoami)
for dir in server agent; do
Expand Down Expand Up @@ -118,14 +148,14 @@ pip install -r $FTEST/requirements-ftest.txt

sudo PYTHONPATH="$FTEST/util" \
"${VIRTUAL_ENV}"/bin/python $FTEST/config_file_gen.py -n "$HOSTNAME" \
-a /etc/daos/daos_agent.yml -s /etc/daos/daos_server.yml
sudo bash -c 'echo "system_ram_reserved: 4" >> /etc/daos/daos_server.yml'
-a "$AGENT_CONFIG" -s "$SERVER_CONFIG"
sudo bash -c 'echo "system_ram_reserved: 4" >> '"$SERVER_CONFIG"
sudo PYTHONPATH="$FTEST/util" \
"${VIRTUAL_ENV}"/bin/python $FTEST/config_file_gen.py \
-n "$HOSTNAME" -d /etc/daos/daos_control.yml
cat /etc/daos/daos_server.yml
cat /etc/daos/daos_agent.yml
cat /etc/daos/daos_control.yml
-n "$HOSTNAME" -d "$CONTROL_CONFIG"
cat "$SERVER_CONFIG"
cat "$AGENT_CONFIG"
cat "$CONTROL_CONFIG"

# python3.6 does not like deactivate with -u set, later versions are OK with it however.
set +u
Expand Down
7 changes: 7 additions & 0 deletions utils/rpms/daos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
set -eEuo pipefail
set -x
root="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
. "${root}/fpm_common.sh"

Expand Down Expand Up @@ -43,6 +44,7 @@ files=()
TARGET_PATH="${sysconfdir}/daos"
list_files files "${SL_PREFIX}/etc/memcheck*.supp"
append_install_list "${files[@]}"
CONFIG_FILES+=("${TARGET_PATH}/memcheck-cart.supp")

TARGET_PATH="${sysconfdir}/bash_completion.d"
list_files files "${SL_PREFIX}/etc/bash_completion.d/daos.bash"
Expand Down Expand Up @@ -130,6 +132,8 @@ if [ -f "${SL_PREFIX}/bin/daos_server" ]; then
list_files files "${SL_PREFIX}/etc/daos_server.yml" \
"${SL_PREFIX}/etc/vos_size_input.yaml"
append_install_list "${files[@]}"
CONFIG_FILES+=("${TARGET_PATH}/daos_server.yml")
CONFIG_FILES+=("${TARGET_PATH}/vos_size_input.yaml")

TARGET_PATH="${datadir}/daos/control"
list_files files "${SL_PREFIX}/share/daos/control/*"
Expand Down Expand Up @@ -225,6 +229,7 @@ append_install_list "${files[@]}"
TARGET_PATH="${sysconfdir}/daos"
list_files files "${SL_PREFIX}/etc/daos_control.yml"
append_install_list "${files[@]}"
CONFIG_FILES+=("${TARGET_PATH}/daos_control.yml")

DEPENDS=( "daos = ${VERSION}-${RELEASE}" )
build_package "daos-admin"
Expand Down Expand Up @@ -269,6 +274,7 @@ append_install_list "${files[@]}"
TARGET_PATH="${sysconfdir}/daos"
list_files files "${SL_PREFIX}/etc/daos_agent.yml"
append_install_list "${files[@]}"
CONFIG_FILES+=("${TARGET_PATH}/daos_agent.yml")

mkdir -p "${tmp}/${unitdir}"
install -m 644 "utils/systemd/${agent_svc_name}" "${tmp}/${unitdir}"
Expand Down Expand Up @@ -354,6 +360,7 @@ append_install_list "${files[@]}"
TARGET_PATH="${sysconfdir}/daos"
list_files files "${SL_PREFIX}/etc/fault-inject-cart.yaml"
append_install_list "${files[@]}"
CONFIG_FILES+=("${TARGET_PATH}/fault-inject-cart.yaml")

#todo add external depends
EXTERNAL_DEPENDS=("${protobufc_lib}")
Expand Down
5 changes: 5 additions & 0 deletions utils/rpms/fpm_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export install_list=()
export PACKAGE_TYPE="dir"
export dbg_list=()
export CONFLICTS=()
export CONFIG_FILES=()
export DEPENDS=()
export EXTERNAL_DEPENDS=()
export EXTRA_OPTS=()
Expand Down Expand Up @@ -167,6 +168,8 @@ build_package() {
create_opts "--depends" depends "${DEPENDS[@]}" "${EXTERNAL_DEPENDS[@]}"
conflicts=()
create_opts "--conflicts" conflicts "${CONFLICTS[@]}"
config_files=()
create_opts "--config-files" config_files "${CONFIG_FILES[@]}"
pkgname="${name}-${VERSION}-${RELEASE}.${ARCH}.${output_type}"
rm -f "${pkgname}"
# shellcheck disable=SC2068
Expand All @@ -184,13 +187,15 @@ build_package() {
--prefix "" \
"${depends[@]}" \
"${conflicts[@]}" \
"${config_files[@]}" \
"${EXTRA_OPTS[@]}" \
"${install_list[@]}"

export EXTRA_OPTS=()
install_list=()

CONFLICTS=()
CONFIG_FILES=()
DEPENDS=()
EXTERNAL_DEPENDS=()
if [[ ! "${name}" =~ debuginfo ]]; then
Expand Down
Loading