2023-01-24 08:21:39 +00:00
|
|
|
load "${REPOSITORY_ROOT}/test/helper/common"
|
|
|
|
load "${REPOSITORY_ROOT}/test/helper/setup"
|
2022-04-06 14:48:41 +00:00
|
|
|
|
2023-01-24 08:21:39 +00:00
|
|
|
BATS_TEST_NAME_PREFIX='[Timezone] '
|
|
|
|
CONTAINER_NAME='dms-test_timezone'
|
2022-04-06 14:48:41 +00:00
|
|
|
|
2023-01-24 08:21:39 +00:00
|
|
|
function setup_file() {
|
|
|
|
_init_with_defaults
|
|
|
|
local CUSTOM_SETUP_ARGUMENTS=(--env TZ='Asia/Jakarta')
|
|
|
|
_common_container_setup 'CUSTOM_SETUP_ARGUMENTS'
|
2022-04-06 14:48:41 +00:00
|
|
|
}
|
|
|
|
|
2023-01-24 08:21:39 +00:00
|
|
|
function teardown_file() { _default_teardown ; }
|
2022-04-06 14:48:41 +00:00
|
|
|
|
2023-01-24 08:21:39 +00:00
|
|
|
@test "setting the time with TZ works correctly" {
|
|
|
|
_run_in_container cat /etc/timezone
|
2022-04-06 14:48:41 +00:00
|
|
|
assert_success
|
|
|
|
assert_output 'Asia/Jakarta'
|
|
|
|
|
2023-01-24 08:21:39 +00:00
|
|
|
_run_in_container date '+%Z'
|
2022-04-06 14:48:41 +00:00
|
|
|
assert_success
|
|
|
|
assert_output 'WIB'
|
|
|
|
}
|