2022-04-06 14:48:41 +00:00
|
|
|
load 'test_helper/common'
|
|
|
|
|
|
|
|
setup_file() {
|
|
|
|
local PRIVATE_CONFIG
|
2022-05-05 08:28:38 +00:00
|
|
|
PRIVATE_CONFIG=$(duplicate_config_for_container .)
|
2022-04-06 14:48:41 +00:00
|
|
|
|
|
|
|
docker run -d --name mail_time \
|
|
|
|
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
|
|
|
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
|
|
|
-e TZ='Asia/Jakarta' \
|
|
|
|
-e LOG_LEVEL=debug \
|
|
|
|
-h mail.my-domain.com -t "${NAME}"
|
|
|
|
|
|
|
|
wait_for_smtp_port_in_container mail_time
|
|
|
|
}
|
|
|
|
|
|
|
|
teardown_file() {
|
2022-05-30 00:53:30 +00:00
|
|
|
docker rm -f mail_time
|
2022-04-06 14:48:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "checking time: setting the time with TZ works correctly" {
|
|
|
|
run docker exec mail_time cat /etc/timezone
|
|
|
|
assert_success
|
|
|
|
assert_output 'Asia/Jakarta'
|
|
|
|
|
|
|
|
run docker exec mail_time date '+%Z'
|
|
|
|
assert_success
|
|
|
|
assert_output 'WIB'
|
|
|
|
}
|