Skip to content

Commit

Permalink
- Makefile now works with freebsd (date command options are diff)
Browse files Browse the repository at this point in the history
date still issues warning and ignores TZ

- Updated tests to work inside bsd jails (127 addresses are an issue)
Signed-off-by: Brian Coca <[email protected]>
  • Loading branch information
bcoca committed Aug 29, 2012
1 parent 00c4c5c commit 83d1028
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/make

# WARN: gmake syntax
########################################################
# Makefile for Ansible
#
Expand All @@ -15,6 +15,7 @@
# variable section

NAME = "ansible"
OS = $(shell uname -s)

# Manpages are currently built with asciidoc -- would like to move to markdown
# This doesn't evaluate until it's called. The -D argument is the
Expand All @@ -32,7 +33,12 @@ VERSION := $(shell cat VERSION)
ifneq ($(shell which git),)
GIT_DATE := $(shell git log -n 1 --format="%ai")
endif

ifeq ($(OS), FreeBSD)
DATE := $(shell date -j -f "%Y-%m-%d %H:%M:%s" "$(GIT_DATE)" +%Y%m%d%H%M)
else
DATE := $(shell date --date="$(GIT_DATE)" +%Y%m%d%H%M)
endif

# RPM build parameters
RPMSPECDIR= packaging/rpm
Expand Down
2 changes: 1 addition & 1 deletion test/TestPlayBook.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_one(self):
print "**ACTUAL**"
print utils.jsonify(actual, format=True)
expected = {
"127.0.0.2": {
"localhost": {
"changed": 9,
"failures": 0,
"ok": 11,
Expand Down
6 changes: 3 additions & 3 deletions test/TestRunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def _run(self, module_name, module_args, background=0):
# when using nosetests this will only show up on failure
# which is pretty useful
print "RESULTS=%s" % results
assert "127.0.0.2" in results['contacted']
return results['contacted']['127.0.0.2']
assert "localhost" in results['contacted']
return results['contacted']['localhost']

def test_ping(self):
result = self._run('ping', [])
Expand Down Expand Up @@ -193,7 +193,7 @@ def test_async(self):

def test_fetch(self):
input_ = self._get_test_file('sample.j2')
output = os.path.join(self.stage_dir, '127.0.0.2', input_)
output = os.path.join(self.stage_dir, 'localhost', input_)
result = self._run('fetch', [ "src=%s" % input_, "dest=%s" % self.stage_dir ])
assert os.path.exists(output)
assert open(input_).read() == open(output).read()
Expand Down
2 changes: 1 addition & 1 deletion test/ansible_hosts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[somegroup]
127.0.0.2
localhost
2 changes: 1 addition & 1 deletion test/assemble.d/01-source.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This is the second comment.
127.0.0.2
localhost

0 comments on commit 83d1028

Please sign in to comment.