diff --git a/README.md b/README.md index 60029063..77464bad 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Build Status](https://secure.travis-ci.org/purpleidea/mgmt.png?branch=master)](http://travis-ci.org/purpleidea/mgmt) [![Documentation](https://img.shields.io/docs/markdown.png)](DOCUMENTATION.md) [![IRC](https://img.shields.io/irc/%23mgmtconfig.png)](https://webchat.freenode.net/?channels=#mgmtconfig) +[![Jenkins](https://img.shields.io/jenkins/status.png)](https://ci.centos.org/job/purpleidea-mgmt/) ## Documentation: Please see: [DOCUMENTATION.md](DOCUMENTATION.md) or [PDF](https://pdfdoc-purpleidea.rhcloud.com/pdf/https://github.com/purpleidea/mgmt/blob/master/DOCUMENTATION.md). @@ -15,6 +16,7 @@ Please look in the [examples/](examples/) folder! ## Bugs: Please set the `DEBUG` constant in [main.go](https://github.com/purpleidea/mgmt/blob/master/main.go) to `true`, and post the logs when you report the [issue](https://github.com/purpleidea/mgmt/issues). +Bonus points if you provide an [OMV](https://github.com/purpleidea/mgmt/tree/master/test/omv) reproducible test case. There are currently a few known bugs which I hope to squash soon. ## Notes: diff --git a/misc/make-deps.sh b/misc/make-deps.sh index e07716ab..15f4cabf 100755 --- a/misc/make-deps.sh +++ b/misc/make-deps.sh @@ -14,7 +14,6 @@ if [ $travis -eq 0 ]; then fi sudo yum install -y golang golang-googlecode-tools-stringer sudo yum install -y hg # some go dependencies are stored in mercurial - sudo yum install -y etcd fi # build etcd diff --git a/misc/make-gopath.sh b/misc/make-gopath.sh new file mode 100755 index 00000000..ea6ad5e2 --- /dev/null +++ b/misc/make-gopath.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# setup a simple go environment + +if ! env | grep -q '^GOPATH='; then + export GOPATH="$HOME/gopath/" + mkdir "$GOPATH" + if ! grep -q '^export GOPATH=' ~/.bashrc; then + echo "export GOPATH=~/gopath/" >> ~/.bashrc + fi + echo "setting go path to: $GOPATH" +fi + +echo "gopath is: $GOPATH" + +# some versions of golang apparently require this to run go get :( +if ! env | grep -q '^GOBIN='; then + export GOBIN="${GOPATH}bin/" + mkdir "$GOBIN" + if ! grep -q '^export GOBIN=' ~/.bashrc; then + echo 'export GOBIN="${GOPATH}bin/"' >> ~/.bashrc + fi + echo "setting go bin to: $GOBIN" +fi + +echo "gobin is: $GOBIN" diff --git a/test.sh b/test.sh index 31de3633..229111d6 100755 --- a/test.sh +++ b/test.sh @@ -21,3 +21,8 @@ if env | grep -q -e '^TRAVIS=true$' -e '^JENKINS_URL='; then go test -race ./test/test-shell.sh fi + +# run omv tests on jenkins physical hosts only +if env | grep -q -e '^JENKINS_URL='; then + ./test/test-omv.sh +fi diff --git a/test/omv/helloworld.yaml b/test/omv/helloworld.yaml new file mode 100644 index 00000000..c6d781a6 --- /dev/null +++ b/test/omv/helloworld.yaml @@ -0,0 +1,51 @@ +--- +:domain: example.com +:network: 192.168.123.0/24 +:image: fedora-23 +:cpus: '' +:memory: '' +:disks: 0 +:disksize: 40G +:boxurlprefix: '' +:sync: rsync +:syncdir: '' +:syncsrc: '' +:folder: ".omv" +:extern: +- type: git + repository: https://github.com/purpleidea/mgmt + directory: mgmt +:cd: '' +:puppet: false +:classes: [] +:shell: +- mkdir /tmp/mgmt/ +:docker: false +:kubernetes: false +:ansible: [] +:playbook: [] +:ansible_extras: {} +:cachier: false +:vms: +- :name: etcd + :shell: + - iptables -F + - cd /vagrant/mgmt/ && make deps && make build && cp mgmt ~/bin/ + - etcd -bind-addr "`hostname --ip-address`:2379" & + - cd && mgmt --help +:namespace: omv +:count: 0 +:username: '' +:password: '' +:poolid: true +:repos: [] +:update: false +:reboot: false +:unsafe: false +:nested: false +:tests: +- omv up etcd +- vssh root@etcd -c pidof etcd +- omv destroy +:comment: simple hello world test case for mgmt +:reallyrm: false diff --git a/test/test-omv.sh b/test/test-omv.sh new file mode 100755 index 00000000..2bebf4e4 --- /dev/null +++ b/test/test-omv.sh @@ -0,0 +1,3 @@ +#!/bin/bash -ie +# simple test harness for testing mgmt via omv +vtest+ omv/helloworld.yaml