Fixed test for update password

This commit is contained in:
Cody Alton 2016-12-21 13:53:03 -05:00
parent 29b66fbef0
commit 7f3bb902e4
1 changed files with 32 additions and 18 deletions

View File

@ -239,24 +239,6 @@
[ "$output" -eq 7 ]
}
@test "checking user updating password for user in /tmp/docker-mailserver/postfix-accounts.cf" {
docker exec mail /bin/sh -c "addmailuser user3@domain.tld mypassword"
initialpass=$(run docker exec mail /bin/sh -c "grep user3@domain.tld -i /tmp/docker-mailserver/postfix-accounts.cf")
sleep 2
docker exec mail /bin/sh -c "updatemailuser user3@domain.tld mynewpassword"
sleep 2
changepass=$(run docker exec mail /bin/sh -c "grep user3@domain.tld -i /tmp/docker-mailserver/postfix-accounts.cf")
if [ initialpass != changepass ]; then
status="0"
else
status="1"
fi
[ "$status" -eq 0 ]
}
#
# postfix
#
@ -663,6 +645,27 @@
[ -z "$output" ]
}
@test "checking user updating password for user in /tmp/docker-mailserver/postfix-accounts.cf" {
docker exec mail /bin/sh -c "addmailuser user3@domain.tld mypassword"
initialpass=$(run docker exec mail /bin/sh -c "grep user3@domain.tld -i /tmp/docker-mailserver/postfix-accounts.cf")
sleep 2
docker exec mail /bin/sh -c "updatemailuser user3@domain.tld mynewpassword"
sleep 2
changepass=$(run docker exec mail /bin/sh -c "grep user3@domain.tld -i /tmp/docker-mailserver/postfix-accounts.cf")
if [ initialpass != changepass ]; then
status="0"
else
status="1"
fi
docker exec mail /bin/sh -c "delmailuser user3@domain.tld"
[ "$status" -eq 0 ]
}
@test "checking accounts: listmailuser" {
run docker exec mail /bin/sh -c "listmailuser | head -n 1"
[ "$status" -eq 0 ]
@ -748,6 +751,17 @@
run ./setup.sh -c mail email list
[ "$status" -eq 0 ]
}
@test "checking setup.sh: setup.sh email update" {
initialpass=$(cat ./config/postfix-accounts.cf | grep lorem@impsum.org | awk -F '|' '{print $2}')
run ./setup.sh -c mail email update lorem@impsum.org consectetur
updatepass=$(cat ./config/postfix-accounts.cf | grep lorem@impsum.org | awk -F '|' '{print $2}')
if [ initialpass != changepass ]; then
status="0"
else
status="1"
fi
[ "$status" -eq 0 ]
}
@test "checking setup.sh: setup.sh email del" {
run ./setup.sh -c mail email del lorem@impsum.org
[ "$status" -eq 0 ]