From 7818abd6a89a882cabb3d2a14a572308d9e959ff Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 21 Jun 2016 17:38:00 -0700 Subject: minor ruby linting --- bin/puppet_command | 6 +++--- bin/run_tests | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/puppet_command b/bin/puppet_command index eb3cd0b9..a06b4940 100755 --- a/bin/puppet_command +++ b/bin/puppet_command @@ -173,9 +173,9 @@ def platform_version_check! return unless @info["platform"] new_version = @info["platform"].split(' ').first return unless new_version - if File.exists?(SUMMARY_LOG) && File.size(SUMMARY_LOG) != 0 + if File.exist?(SUMMARY_LOG) && File.size(SUMMARY_LOG) != 0 file = SUMMARY_LOG - elsif File.exists?(SUMMARY_LOG_1) && File.size(SUMMARY_LOG_1) != 0 + elsif File.exist?(SUMMARY_LOG_1) && File.size(SUMMARY_LOG_1) != 0 file = SUMMARY_LOG_1 else return @@ -195,7 +195,7 @@ end # Return a ruby object representing the contents of the hiera yaml file. # def hiera_file - unless File.exists?(HIERA_FILE) + unless File.exist?(HIERA_FILE) log("ERROR: hiera file '#{HIERA_FILE}' does not exist.") exit(1) end diff --git a/bin/run_tests b/bin/run_tests index b6784ed5..b25a419c 100755 --- a/bin/run_tests +++ b/bin/run_tests @@ -459,7 +459,7 @@ end def main # load node data from hiera file - if File.exists?(HIERA_FILE) + if File.exist?(HIERA_FILE) $node = YAML.load_file(HIERA_FILE) else $node = {"services" => [], "dummy" => true} -- cgit v1.2.3 From f31d974b33bf8ac760ae1ba56c583081f51f7bce Mon Sep 17 00:00:00 2001 From: varac Date: Fri, 15 Jul 2016 17:43:53 +0200 Subject: Use bin/ci-build.sh as build script - Use dynamic build vm names --- bin/ci-build.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 bin/ci-build.sh (limited to 'bin') diff --git a/bin/ci-build.sh b/bin/ci-build.sh new file mode 100755 index 00000000..3cb994e5 --- /dev/null +++ b/bin/ci-build.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +. tests/puppet/provider/.platform-test.conf + +# create node(s) with unique id so we can run tests in parallel +export TAG="build${CI_BUILD_ID}" +[ -d "${PROVIDERDIR}/tags" ] || mkdir "${PROVIDERDIR}/tags" +echo '{}' > "${PROVIDERDIR}/tags/${TAG}.json" + +export IP_SUFFIX_START='100' +#NODES='rewdevcouch1:couchdb,soledad rewdevmx1:mx rewdevvpn1:openvpn,tor rewdevweb1:webapp,monitor rewdevplain1: rewdevstatic1:static' +export NODES="single${TAG}:couchdb,soledad,mx,webapp" +leap-platform-test add_nodes "$NODES" + +leap-platform-test -v init_deploy +leap-platform-test -v test +cd tests/puppet/provider +bundle exec leap info +bundle exec leap local destroy -- cgit v1.2.3 From e075f1dad155af6c30eec7be52e6ac0f2c779f6b Mon Sep 17 00:00:00 2001 From: varac Date: Fri, 22 Jul 2016 07:56:55 +0200 Subject: Test all services on CI --- bin/ci-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/ci-build.sh b/bin/ci-build.sh index 3cb994e5..d9e37d73 100755 --- a/bin/ci-build.sh +++ b/bin/ci-build.sh @@ -9,7 +9,7 @@ echo '{}' > "${PROVIDERDIR}/tags/${TAG}.json" export IP_SUFFIX_START='100' #NODES='rewdevcouch1:couchdb,soledad rewdevmx1:mx rewdevvpn1:openvpn,tor rewdevweb1:webapp,monitor rewdevplain1: rewdevstatic1:static' -export NODES="single${TAG}:couchdb,soledad,mx,webapp" +export NODES="single${TAG}:couchdb,soledad,mx,webapp,openvpn,tor,monitor,obfsproxy" leap-platform-test add_nodes "$NODES" leap-platform-test -v init_deploy -- cgit v1.2.3 From 9ad1356e7cbbbd9c1ee84c8ab2092974917d09f0 Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 26 Jul 2016 20:34:04 +0200 Subject: [CI] leap info should use tag --- bin/ci-build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/ci-build.sh b/bin/ci-build.sh index d9e37d73..7b4895e5 100755 --- a/bin/ci-build.sh +++ b/bin/ci-build.sh @@ -15,5 +15,5 @@ leap-platform-test add_nodes "$NODES" leap-platform-test -v init_deploy leap-platform-test -v test cd tests/puppet/provider -bundle exec leap info -bundle exec leap local destroy +bundle exec leap info "${TAG}" +bundle exec leap local destroy "${TAG}" -- cgit v1.2.3 From 05fc9658915bfbd1006d9ff8da83fd34df2c78d1 Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 23 Aug 2016 13:34:07 -0700 Subject: locale improvements: allow non-english locales in node_init, enforce UTF8 locale for `puppet apply`. --- bin/node_init | 4 +++- bin/puppet_command | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/node_init b/bin/node_init index da250012..ea4c29c5 100644 --- a/bin/node_init +++ b/bin/node_init @@ -22,7 +22,9 @@ if ! egrep -q "$DEBIAN_VERSION" /etc/debian_version; then exit 1 fi mkdir -p $LEAP_DIR -echo "en_US.UTF-8 UTF-8" > /etc/locale.gen +if ! grep -q -e '^en_US.UTF-8' /etc/locale.gen; then + echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen +fi # # UPDATE PACKAGES diff --git a/bin/puppet_command b/bin/puppet_command index a06b4940..a2876fd9 100755 --- a/bin/puppet_command +++ b/bin/puppet_command @@ -28,7 +28,7 @@ SUMMARY_LOG = '/var/log/leap/deploy-summary.log' SUMMARY_LOG_1 = '/var/log/leap/deploy-summary.log.1' APPLY_START_STR = "STARTING APPLY" APPLY_FINISH_STR = "APPLY COMPLETE" - +LANG = "en_US.UTF-8" def main if File.read('/etc/debian_version') !~ DEBIAN_VERSION @@ -144,7 +144,7 @@ def puppet_apply(options={}, &block) fqdn = hiera_file['domain']['full'] domain = hiera_file['domain']['full_suffix'] Dir.chdir(PUPPET_DIRECTORY) do - return run("FACTER_fqdn='#{fqdn}' FACTER_domain='#{domain}' #{PUPPET_BIN} apply #{custom_parameters(options)} --modulepath='#{modulepath}' #{PUPPET_PARAMETERS} #{manifest}", &block) + return run("LANG='#{LANG}' FACTER_fqdn='#{fqdn}' FACTER_domain='#{domain}' #{PUPPET_BIN} apply #{custom_parameters(options)} --modulepath='#{modulepath}' #{PUPPET_PARAMETERS} #{manifest}", &block) end end -- cgit v1.2.3 From e9a4f439da7355dfe48a3f38aef8e291ea795bef Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 30 Aug 2016 19:48:48 +0200 Subject: break on every deploy error --- bin/ci-build.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bin') diff --git a/bin/ci-build.sh b/bin/ci-build.sh index 7b4895e5..248bd9f8 100755 --- a/bin/ci-build.sh +++ b/bin/ci-build.sh @@ -2,6 +2,9 @@ . tests/puppet/provider/.platform-test.conf +# break on every error +set -e + # create node(s) with unique id so we can run tests in parallel export TAG="build${CI_BUILD_ID}" [ -d "${PROVIDERDIR}/tags" ] || mkdir "${PROVIDERDIR}/tags" -- cgit v1.2.3 From 07c0e60e6bdc5b8bfe1f42f76dae9f0a79e7abb0 Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 29 Aug 2016 16:35:14 -0700 Subject: moved infrastructure tests run by `leap run` to tests/server-tests --- bin/run_tests | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/run_tests b/bin/run_tests index b25a419c..8450a9bf 100755 --- a/bin/run_tests +++ b/bin/run_tests @@ -1,7 +1,7 @@ #!/usr/bin/ruby # -# this script will run the unit tests in ../tests/*.rb. +# This script will run the unit tests in /srv/leap/tests # # Tests for the platform differ from traditional ruby unit tests in a few ways: # @@ -29,11 +29,11 @@ EXIT_CODES = { HIERA_FILE = '/etc/leap/hiera.yaml' HELPER_PATHS = [ - '../../tests/helpers/*.rb', + '/srv/leap/tests/server-tests/helpers/*.rb', '/srv/leap/files/tests/helpers/*.rb' ] TEST_PATHS = [ - '../../tests/white-box/*.rb', + '/srv/leap/tests/server-tests/white-box/*.rb', '/srv/leap/files/tests/white-box/*.rb', '/srv/leap/tests_custom/*.rb' ] -- cgit v1.2.3 From 441a488ac13a6a3cf50d2185f4611f13b54483e7 Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 29 Aug 2016 21:18:03 -0700 Subject: add exec bit on bin/node_init --- bin/node_init | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 bin/node_init (limited to 'bin') diff --git a/bin/node_init b/bin/node_init old mode 100644 new mode 100755 -- cgit v1.2.3 From c4afb0b63fdfaef6a7d67917f5b93e353902d36d Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 30 Aug 2016 15:31:23 -0700 Subject: fix paths for gitlab ci --- bin/ci-build.sh | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100755 bin/ci-build.sh (limited to 'bin') diff --git a/bin/ci-build.sh b/bin/ci-build.sh deleted file mode 100755 index 248bd9f8..00000000 --- a/bin/ci-build.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -. tests/puppet/provider/.platform-test.conf - -# break on every error -set -e - -# create node(s) with unique id so we can run tests in parallel -export TAG="build${CI_BUILD_ID}" -[ -d "${PROVIDERDIR}/tags" ] || mkdir "${PROVIDERDIR}/tags" -echo '{}' > "${PROVIDERDIR}/tags/${TAG}.json" - -export IP_SUFFIX_START='100' -#NODES='rewdevcouch1:couchdb,soledad rewdevmx1:mx rewdevvpn1:openvpn,tor rewdevweb1:webapp,monitor rewdevplain1: rewdevstatic1:static' -export NODES="single${TAG}:couchdb,soledad,mx,webapp,openvpn,tor,monitor,obfsproxy" -leap-platform-test add_nodes "$NODES" - -leap-platform-test -v init_deploy -leap-platform-test -v test -cd tests/puppet/provider -bundle exec leap info "${TAG}" -bundle exec leap local destroy "${TAG}" -- cgit v1.2.3 From d2defb63bba82eb3e6d3cc8885826d8b5a82ed0e Mon Sep 17 00:00:00 2001 From: kwadronaut Date: Tue, 4 Oct 2016 23:55:52 +0200 Subject: generate utf8 locale solves #8511 --- bin/node_init | 1 + 1 file changed, 1 insertion(+) (limited to 'bin') diff --git a/bin/node_init b/bin/node_init index ea4c29c5..12d491c4 100755 --- a/bin/node_init +++ b/bin/node_init @@ -24,6 +24,7 @@ fi mkdir -p $LEAP_DIR if ! grep -q -e '^en_US.UTF-8' /etc/locale.gen; then echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen + /usr/sbin/locale-gen fi # -- cgit v1.2.3 From 0bafc5e17a465969673e6807d3e6e7d7668ec481 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 18 Oct 2016 11:28:03 -0400 Subject: Do a dist-upgrade in 'node init'. Starting with a recent debian stable point release update, it is possible that the system is in an inconsistent library state. For example, puppet could not be run because the libraries on the system were not the ones that the puppet package was built against. So that means that deploys could not happen until we've dont a dist-upgrade. --- bin/node_init | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bin') diff --git a/bin/node_init b/bin/node_init index 12d491c4..b55cfed3 100755 --- a/bin/node_init +++ b/bin/node_init @@ -52,6 +52,8 @@ if [[ $error_count > 0 ]]; then exit 1 fi +/usr/bin/apt-get -q -y -o 'DPkg::Options::=--force-confold' dist-upgrade + # # UPDATE TIME # -- cgit v1.2.3