Skip to content

Commit

Permalink
Testing additional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ericeberry committed Dec 3, 2024
1 parent fa1349e commit 5419376
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
# variables = var_password_hashing_algorithm=good_value1|good_value2

if grep -q "^ENCRYPT_METHOD" /etc/login.defs; then
sed -i "s/^ENCRYPT_METHOD\b.*/ENCRYPT_METHOD wrong_value/" /etc/login.defs
else
echo "ENCRYPT_METHOD wrong_value" >> /etc/login.defs
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
# variables = var_password_hashing_algorithm=good_value1|good_value2

if grep -q "^ENCRYPT_METHOD" /etc/login.defs; then
sed -i "s/^ENCRYPT_METHOD\b.*/ENCRYPT_METHOD good_value2/" /etc/login.defs
else
echo "ENCRYPT_METHOD good_value2" >> /etc/login.defs
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
# variables = var_password_hashing_algorithm=good_value1|good_value2

if grep -q "^ENCRYPT_METHOD" /etc/login.defs; then
sed -i "s/^ENCRYPT_METHOD\b.*/ENCRYPT_METHOD good_value1/" /etc/login.defs
else
echo "ENCRYPT_METHOD good_value1" >> /etc/login.defs
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
# variables = var_password_hashing_algorithm=value1|value2

# test that partial match fails
if grep -q "^ENCRYPT_METHOD" /etc/login.defs; then
sed -i "s/^ENCRYPT_METHOD\b.*/ENCRYPT_METHOD value/" /etc/login.defs
else
echo "ENCRYPT_METHOD value" >> /etc/login.defs
fi

0 comments on commit 5419376

Please sign in to comment.