Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made UTC timezone explicit in common/init.sls. #439

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Added test for UTC timezone.

  • Loading branch information
Rowan Bulkow
Rowan Bulkow committed Jul 15, 2016
commit 8e4014ebb6165df200ac670d04e4064c0c803250
@@ -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

This comment has been minimized.

Copy link
@aneeshusa

aneeshusa Jul 15, 2016

Member

Two things:

  • this can be just sls.common, all of the test files in that dir will get run automatically.
  • we want to run the common tests on all nodes, not just servo-master1, so that should happen outside the conditional.
fi
fi
No changes.
@@ -0,0 +1,18 @@
import subprocess

from tests.util import Failure, Success


def run():
command = "date | grep -v UTC"

This comment has been minimized.

Copy link
@aneeshusa

aneeshusa Jul 15, 2016

Member

Instead of using pipes and an extra grep process, let's just look for UTC in the output of the date command inside Python.

ret = subprocess.run(command,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True,
shell=True)

This comment has been minimized.

Copy link
@aneeshusa

aneeshusa Jul 15, 2016

Member

Please remove shell=True, it can cause security problems (and also spawns an extra process).


if ret.returncode == 1:
return Success("Date is in UTC")
else:
return Failure("Date is not in UTC: ", ret.stdout)

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.