mirror of
https://github.com/projectatomic/atomic.git
synced 2026-02-05 09:44:59 +01:00
Integration test: Create d-s-s config if it does not exist
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com> Closes: #924 Approved by: rhatdan
This commit is contained in:
committed by
Atomic Bot
parent
d5c6ea2279
commit
2ea2a32f19
@@ -66,30 +66,22 @@ teardown () {
|
||||
setup
|
||||
trap teardown EXIT
|
||||
|
||||
# Running without /e/s/d-s-s should fail.
|
||||
# If /etc/sysconfig/docker-storage-setup is missing, atomic should create the file.
|
||||
|
||||
set +e
|
||||
rm -f /etc/sysconfig/docker-storage-setup
|
||||
OUTPUT=$(${ATOMIC} storage modify --add-device $TEST_DEV_1 2>&1)
|
||||
if [[ $? -eq 0 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
set -e
|
||||
echo $OUTPUT | grep -q "No such file or directory"
|
||||
grep -q "^DEVS=\"$TEST_DEV_1\"$" /etc/sysconfig/docker-storage-setup
|
||||
|
||||
if [ -n "$VGROUP" ]; then
|
||||
cat >/etc/sysconfig/docker-storage-setup <<EOF
|
||||
cat >>/etc/sysconfig/docker-storage-setup <<EOF
|
||||
MIN_DATA_SIZE=0G
|
||||
DEVS=""
|
||||
EOF
|
||||
|
||||
# Adding a device should put it into the volume group and should add
|
||||
# it to /etc/sysconfig/docker-storage-setup.
|
||||
# Executing docker-storage-setup should add the device
|
||||
# and put it into the volume group.
|
||||
|
||||
${ATOMIC} storage modify --add-device $TEST_DEV_1
|
||||
/usr/bin/docker-storage-setup 1>/dev/null||exit 1
|
||||
[ $(pvs --noheadings -o vg_name $TEST_DEV_1_pvs) == $VGROUP ]
|
||||
grep -q "^DEVS=\"$TEST_DEV_1\"$" /etc/sysconfig/docker-storage-setup
|
||||
|
||||
# Removing it should undo all that.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user