Skip to content

Commit

Permalink
Simplify and align logic in test scenarios
Browse files Browse the repository at this point in the history
Signed-off-by: Marcus Burghardt <[email protected]>
  • Loading branch information
marcusburghardt committed Sep 13, 2024
1 parent 6ab56a4 commit c299868
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/bash
# packages = sssd-common

rm -rf /etc/sssd/conf.d/
mkdir -p /etc/sssd/conf.d/
SSSD_CONF="/etc/sssd/conf.d/sssd.conf"
SSSD_CONF_FILE="/etc/sssd/sssd.conf"
SSSD_CONF_DIR_FILE="/etc/sssd/conf.d/sssd.conf"
SSSD_CONF_DIR_FILES="/etc/sssd/conf.d/*.conf"

cp wrong_sssd.conf $SSSD_CONF
rm -rf $SSSD_CONF_FILE $SSSD_CONF_DIR_FILES

SSSD_CONF="/etc/sssd/sssd.conf"
cp wrong_sssd.conf $SSSD_CONF
for file in $SSSD_CONF_FILE $SSSD_CONF_DIR_FILE; do
cp wrong_sssd.conf $file
done
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/bash
# packages = sssd-common

rm /etc/sssd/sssd.conf
rm -rf /etc/sssd/conf.d/
SSSD_CONF_FILE="/etc/sssd/sssd.conf"
SSSD_CONF_DIR_FILES="/etc/sssd/conf.d/*.conf"

rm -rf $SSSD_CONF_FILE $SSSD_CONF_DIR_FILES

# Only empty config without any section
touch /etc/sssd/sssd.conf
touch $SSSD_CONF_FILE
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/bin/bash
# packages = sssd-common

rm -rf /etc/sssd/conf.d/
mkdir -p /etc/sssd/conf.d/
SSSD_CONF="/etc/sssd/conf.d/sssd.conf"
SSSD_CONF_FILE="/etc/sssd/sssd.conf"
SSSD_CONF_DIR_FILE="/etc/sssd/conf.d/sssd.conf"
SSSD_CONF_DIR_FILES="/etc/sssd/conf.d/*.conf"

cp wrong_sssd.conf $SSSD_CONF
rm -rf $SSSD_CONF_FILE $SSSD_CONF_DIR_FILES

SSSD_CONF="/etc/sssd/sssd.conf"
cp wrong_sssd.conf $SSSD_CONF
for file in $SSSD_CONF_FILE $SSSD_CONF_DIR_FILE; do
cp wrong_sssd.conf $file
done

SSSD_CONF="/etc/sssd/sssd_custom.conf"
cat <<EOF > $SSSD_CONF
cat <<EOF > "/etc/sssd/conf.d/sssd_custom.conf"
[sssd]
services = nss
domains = shadowutils
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
# packages = sssd-common
#

SSSD_CONF="/etc/sssd/sssd.conf"
SSSD_CONF_FILE="/etc/sssd/sssd.conf"
SSSD_CONF_DIR_FILES="/etc/sssd/conf.d/*.conf"

rm -rf /etc/sssd/conf.d/
rm -f $SSSD_CONF
cat <<EOF > $SSSD_CONF
rm -rf $SSSD_CONF_FILE $SSSD_CONF_DIR_FILES

cat <<EOF > $SSSD_CONF_FILE
[sssd]
section1 = key
section2 = nss
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
# packages = sssd-common

rm -rf /etc/sssd/conf.d/
SSSD_CONF="/etc/sssd/sssd.conf"
cp wrong_sssd.conf $SSSD_CONF
SSSD_CONF_FILE="/etc/sssd/sssd.conf"
SSSD_CONF_DIR_FILES="/etc/sssd/conf.d/*.conf"

rm -rf $SSSD_CONF_FILE $SSSD_CONF_DIR_FILES
cp wrong_sssd.conf $SSSD_CONF_FILE
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
# packages = sssd-common
# remediation = none

rm /etc/sssd/sssd.conf
rm -rf /etc/sssd/conf.d/
SSSD_CONF_FILE="/etc/sssd/sssd.conf"
SSSD_CONF_DIR_FILES="/etc/sssd/conf.d/*.conf"

rm -rf $SSSD_CONF_FILE $SSSD_CONF_DIR_FILES
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/bash
# packages = sssd-common

SSSD_CONF="/etc/sssd/sssd.conf"
SSSD_CONF_FILE="/etc/sssd/sssd.conf"
SSSD_CONF_DIR_FILES="/etc/sssd/conf.d/*.conf"

rm -rf /etc/sssd/conf.d/
rm -f SSSD_CONF
cat <<EOF > $SSSD_CONF
rm -rf $SSSD_CONF_FILE $SSSD_CONF_DIR_FILES

cat <<EOF > $SSSD_CONF_FILE
[sssd]
services = nss,pam
[pam]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/bin/bash
# packages = sssd-common

rm -rf "/etc/sssd/conf.d/"
rm -f "/etc/sssd/sssd.conf"
mkdir -p "/etc/sssd/conf.d/"
cat <<EOF > "/etc/sssd/conf.d/sssd.conf"
SSSD_CONF_FILE="/etc/sssd/sssd.conf"
SSSD_CONF_DIR_FILE="/etc/sssd/conf.d/sssd.conf"
SSSD_CONF_DIR_FILES="/etc/sssd/conf.d/*.conf"

rm -rf $SSSD_CONF_FILE $SSSD_CONF_DIR_FILES

cat <<EOF > $SSSD_CONF_DIR_FILE
[sssd]
services = nss,pam
[pam]
Expand Down

0 comments on commit c299868

Please sign in to comment.