From 80b816a46d31b0990a08b644b87605601ecf7c85 Mon Sep 17 00:00:00 2001 From: Rowan Bulkow Date: Fri, 15 Jul 2016 13:04:37 -0400 Subject: [PATCH 1/3] Made UTC timezone explicit in common/init.sls. --- common/init.sls | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/init.sls b/common/init.sls index 4963ba0a..1d5c238d 100644 --- a/common/init.sls +++ b/common/init.sls @@ -40,6 +40,9 @@ servo: - shell: /bin/bash - home: {{ common.servo_home }} +Etc/UTC: + timezone.system + {% for hostname, ip in common.hosts.items() %} host-{{ hostname }}: host.present: From c4dc7abcd6ce71e92f27707ea1d4a3cc5dd9363a Mon Sep 17 00:00:00 2001 From: Rowan Bulkow Date: Fri, 15 Jul 2016 13:59:45 -0400 Subject: [PATCH 2/3] fixup! Made UTC timezone explicit in common/init.sls. --- common/init.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/init.sls b/common/init.sls index 1d5c238d..9d0970fe 100644 --- a/common/init.sls +++ b/common/init.sls @@ -40,7 +40,7 @@ servo: - shell: /bin/bash - home: {{ common.servo_home }} -Etc/UTC: +UTC: timezone.system {% for hostname, ip in common.hosts.items() %} From 8e4014ebb6165df200ac670d04e4064c0c803250 Mon Sep 17 00:00:00 2001 From: Rowan Bulkow Date: Fri, 15 Jul 2016 14:28:20 -0400 Subject: [PATCH 3/3] Added test for UTC timezone. --- .travis/dispatch.sh | 2 +- tests/sls/common/__init__.py | 0 tests/sls/common/timezone.py | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 tests/sls/common/__init__.py create mode 100644 tests/sls/common/timezone.py diff --git a/.travis/dispatch.sh b/.travis/dispatch.sh index 7a6111a5..b963f7d5 100755 --- a/.travis/dispatch.sh +++ b/.travis/dispatch.sh @@ -53,6 +53,6 @@ else # Only run tests against the new configuration # TODO: don't hard-code this if [[ "${SALT_NODE_ID}" == "servo-master1" ]]; then - ./test.py sls.buildbot.master sls.homu sls.nginx + ./test.py sls.buildbot.master sls.common.timezone sls.homu sls.nginx fi fi diff --git a/tests/sls/common/__init__.py b/tests/sls/common/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/sls/common/timezone.py b/tests/sls/common/timezone.py new file mode 100644 index 00000000..1e5f4675 --- /dev/null +++ b/tests/sls/common/timezone.py @@ -0,0 +1,18 @@ +import subprocess + +from tests.util import Failure, Success + + +def run(): + command = "date | grep -v UTC" + ret = subprocess.run(command, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + universal_newlines=True, + shell=True) + + if ret.returncode == 1: + return Success("Date is in UTC") + else: + return Failure("Date is not in UTC: ", ret.stdout) +