summaryrefslogtreecommitdiff
path: root/files/puppet
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2017-04-19 01:44:31 +0200
committervarac <varacanero@zeromail.org>2017-04-19 01:44:31 +0200
commitd4171c00773e1ca8b05cf9c1be23d1227d9bd9af (patch)
treebf18b67e9158437355900fb6fa2ef42312848caa /files/puppet
parentd46074423179768632f8f786281c4870b6fb4e0e (diff)
git subrepo pull files/puppet/modules/pixelated
subrepo: subdir: "files/puppet/modules/pixelated" merged: "6dc72f4" upstream: origin: "https://github.com/pixelated/puppet-pixelated.git" branch: "master" commit: "6dc72f4" git-subrepo: version: "0.3.1" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "3202adb"
Diffstat (limited to 'files/puppet')
-rw-r--r--files/puppet/modules/pixelated/.gitignore3
-rw-r--r--files/puppet/modules/pixelated/.gitrepo4
-rw-r--r--files/puppet/modules/pixelated/README.md6
-rw-r--r--files/puppet/modules/pixelated/circle.yml21
-rw-r--r--files/puppet/modules/pixelated/files/check_mk/user-agent.cfg33
-rw-r--r--files/puppet/modules/pixelated/files/functional-tests/page_objects/login_page.py6
-rw-r--r--files/puppet/modules/pixelated/files/functional-tests/steps/account.py12
-rwxr-xr-xfiles/puppet/modules/pixelated/files/prefer_package_repo.sh78
-rw-r--r--files/puppet/modules/pixelated/manifests/apt.pp8
-rw-r--r--files/puppet/modules/pixelated/manifests/apt/install_packages_from_pixelated.pp20
-rw-r--r--files/puppet/modules/pixelated/spec/classes/apt_spec.rb12
11 files changed, 182 insertions, 21 deletions
diff --git a/files/puppet/modules/pixelated/.gitignore b/files/puppet/modules/pixelated/.gitignore
index 5b60ad3..a60a8bc 100644
--- a/files/puppet/modules/pixelated/.gitignore
+++ b/files/puppet/modules/pixelated/.gitignore
@@ -4,7 +4,8 @@
# deployed by vagrant_platform.sh
/leap_platform
# ignore files created by functional test
-/files/functional-tests/ghostdriver.log
+files/functional-tests/*.log
+files/functional-tests/*.html
*.pyc
# ignore bundles
.bundle/
diff --git a/files/puppet/modules/pixelated/.gitrepo b/files/puppet/modules/pixelated/.gitrepo
index 220fcc1..2f0672a 100644
--- a/files/puppet/modules/pixelated/.gitrepo
+++ b/files/puppet/modules/pixelated/.gitrepo
@@ -6,6 +6,6 @@
[subrepo]
remote = https://github.com/pixelated/puppet-pixelated.git
branch = master
- commit = 0866ce4dc63c8fec263b9638071f32e087324428
- parent = 2d0854bdf212096bbb856072de4cd29f8e1a97c5
+ commit = 6dc72f4c096d1b40b0e599b962e306f48b4654c5
+ parent = d46074423179768632f8f786281c4870b6fb4e0e
cmdver = 0.3.1
diff --git a/files/puppet/modules/pixelated/README.md b/files/puppet/modules/pixelated/README.md
index 6bf6f7a..d44ad37 100644
--- a/files/puppet/modules/pixelated/README.md
+++ b/files/puppet/modules/pixelated/README.md
@@ -92,8 +92,8 @@ Have fun!
### Running Funcional Tests (local)
-From:
-```$cd /puppet-pixelated/files/functional-tests/```
+From:
+```$cd files/functional-tests/```
Install python dependencies:
```$pip install -r test_requirements.txt```
@@ -101,7 +101,7 @@ Install python dependencies:
Install phantomjs:
```$npm install phantomjs -g```
-Setting staging host as pixelated-platform on the TESTHOST environment variable:
+Setting staging host as pixelated-platform on the TESTHOST environment variable:
```$export TESTHOST=staging.pixelated-project.org```
And to run:
diff --git a/files/puppet/modules/pixelated/circle.yml b/files/puppet/modules/pixelated/circle.yml
new file mode 100644
index 0000000..aa12532
--- /dev/null
+++ b/files/puppet/modules/pixelated/circle.yml
@@ -0,0 +1,21 @@
+machine:
+ ruby:
+ version:
+ 2.1.8
+ environment:
+ LC_ALL: 'en_US.UTF-8'
+
+dependencies:
+ override:
+ - sudo apt-get install rbenv
+ - rbenv rehash
+ - bundle install
+
+test:
+ override:
+ - bundle exec rake validate
+ - cp .fixtures-latest.yml .fixtures.yml
+ - bundle exec rake spec
+ - cp .fixtures-leap-pinned.yml .fixtures.yml
+ - bundle exec rake spec
+
diff --git a/files/puppet/modules/pixelated/files/check_mk/user-agent.cfg b/files/puppet/modules/pixelated/files/check_mk/user-agent.cfg
index 8f8620c..b871f00 100644
--- a/files/puppet/modules/pixelated/files/check_mk/user-agent.cfg
+++ b/files/puppet/modules/pixelated/files/check_mk/user-agent.cfg
@@ -1,13 +1,19 @@
/var/log/pixelated/user-agent.log
# ignore requests that are fine
# ignore login with wrong credentials
+ I login\?error
+ I login\?auth-error
I Unauthorized login for
I throwExceptionIntoGenerator
# issue 904
I <class 'leap.soledad.common.l2db.errors.DatabaseDoesNotExist'>
# issue 905
I ERROR got exception when syncing
+ I _unauth_to_invalid_token_error
I leap.soledad.common.errors.InvalidAuthTokenError
+# issue 957
+ I Failure instance: Traceback: <type 'exceptions.RuntimeError'>: Request.finish called on a request after its connection was lost; use Request.notifyFinish to keep track of this.
+ I exceptions.RuntimeError: Request.finish called on a request after its connection was lost; use Request.notifyFinish to keep track of this.
# issue 913
I exception caught here
I exceptions.IOError:.*No such file or directory
@@ -15,17 +21,34 @@
I exceptions.ValueError: No JSON object could be decoded
# issue 975
I Failure instance: Traceback: <class 'leap.bitmask.keymanager.errors.KeyAddressMismatch'>
-# issue 981
- I Failed to encrypt/decrypt: \[GNUPG:\] NODATA 2
- I Failure instance: Traceback: <type 'exceptions.ValueError'>: No JSON object could be decoded
# issue 992
I leap.bitmask.keymanager.errors.EncryptError
+# issue 984
+ I twisted.mail.smtp.SMTPDeliveryError
+# issue 582
+ I errors.RevisionConflict
+# issue 1019
+ I Failed to encrypt/decrypt: \[GNUPG:\] NODATA 2
+ I Failure instance: Traceback: <type 'exceptions.TypeError'>: must be string or buffer, not list
+# issue https://github.com/pixelated/project-issues/issues/428
+ I Failure instance: Traceback: <type 'exceptions.KeyError'>: 'openpgp'
+ I <twisted.python.failure.Failure exceptions.KeyError: 'openpgp'>
+# issue 1036
+ I 'NoneType' object has no attribute 'as_dict'
+# issue leap/soledad#8799
+ I 'NoneType' object has no attribute 'content'
+# issue leap/soledad#8787
+ I 'NoneType' object has no attribute 'commit'
+# issue leap/soledad#8786
+ I 'NoneType' object has no attribute 'cursor'
+# issue leap/bitmask-dev#8820
+ I 'NoneType' object has no attribute 'doc_id'
+# issue 1055
+ I No attachment with id None found!
#
I twisted.internet.error.ConnectionRefusedError: Connection was refused by other side: 111: Connection refused
- I twisted.mail.smtp.SMTPDeliveryError
I exceptions.AssertionError: Found more than one key for address
I column doc_id is not unique
- I u1db.errors.RevisionConflict
I An error has ocurred adding attached key
W warning
C error
diff --git a/files/puppet/modules/pixelated/files/functional-tests/page_objects/login_page.py b/files/puppet/modules/pixelated/files/functional-tests/page_objects/login_page.py
index ae6e31c..8261477 100644
--- a/files/puppet/modules/pixelated/files/functional-tests/page_objects/login_page.py
+++ b/files/puppet/modules/pixelated/files/functional-tests/page_objects/login_page.py
@@ -21,9 +21,9 @@ from selenium.common.exceptions import TimeoutException
class LoginPage(BasePageObject):
def __init__(self, context, timeout=10):
self._locators = {
- 'username': 'input#email',
- 'password': 'input#password',
- 'login_button': 'input[type=submit]',
+ 'username': 'input[name=username]',
+ 'password': 'input[name=password]',
+ 'login_button': 'button[type=submit]',
'hive_svg': 'svg#hive'
}
super(LoginPage, self).__init__(context, timeout)
diff --git a/files/puppet/modules/pixelated/files/functional-tests/steps/account.py b/files/puppet/modules/pixelated/files/functional-tests/steps/account.py
index bdbf2e2..17d6d86 100644
--- a/files/puppet/modules/pixelated/files/functional-tests/steps/account.py
+++ b/files/puppet/modules/pixelated/files/functional-tests/steps/account.py
@@ -33,7 +33,7 @@ def step_impl(context):
@then(u'I should see a login button')
def step_impl(context):
- context.browser.find_element_by_name('login')
+ context.browser.find_element_by_css_selector('button[type=submit]')
@given(u'I\'m logged in')
@@ -47,11 +47,11 @@ def step_impl(context):
@then(u'I see the inbox')
def step_impl(context):
- # phantomjs can not deal with the interstitial. We need to load the
- # website manually after the user-agent has started
- time.sleep(30)
- taglist = TagList(context)
- taglist.is_pixelated_loaded()
+ # phantomjs can not deal with the interstitial. We need to load the
+ # website manually after the user-agent has started
+ time.sleep(30)
+ taglist = TagList(context)
+ taglist.is_pixelated_loaded()
@when(u'I logout')
diff --git a/files/puppet/modules/pixelated/files/prefer_package_repo.sh b/files/puppet/modules/pixelated/files/prefer_package_repo.sh
new file mode 100755
index 0000000..a0d4c43
--- /dev/null
+++ b/files/puppet/modules/pixelated/files/prefer_package_repo.sh
@@ -0,0 +1,78 @@
+#!/bin/bash
+
+# Makes sure that all packages that are available from both LEAP and
+# Pixelated debian repos are instaled from Pixelated
+# Background is that under certain circumstances Pixelated providers end
+# up with some of these packages installed from the LEAP debian repo, and
+# even we pin all Pixelated packages with '1000' in `/etc/apt/preferences.d/pixelated`
+# packages will not downgraded to the Pixelated versions if they are lower than
+# the LEAP ones.
+# see https://github.com/pixelated/project-issues/issues/415 for more details
+
+# Usage:
+#
+# Run this script with 'check' as parameter to check if there are
+# packages installed from a different repo. In this case, the script will
+# exit with an exit code of 1.
+#
+# Without any parameter it will install all available packages from the
+# Pixleated repo.
+
+set -e
+set -o pipefail
+
+options="$*"
+
+# For now, default to pixelated as preferred repo
+# Could get set via a command line option later
+preferred_repo='pixelated'
+preferred_repo_url='packages.pixelated-project.org'
+
+get_installed_packages () {
+ packages="$(aptitude search "?installed?origin(${preferred_repo})" -F '%p' | tr '\n' ' ' | sed 's/ */ /g' )"
+ echo "${packages}"
+}
+
+get_installed_packages_from_other_repo () {
+ packages="$(get_installed_packages)"
+
+ installed=()
+ for deb in $packages
+ do
+ url=$(apt-cache policy "$deb" | awk '/\*\*\*/{getline; print}' | grep -oP 'http.*? ')
+ if [[ ! "$url" =~ $preferred_repo_url ]]
+ then
+ installed+=(${deb})
+ fi
+ done
+ echo "${installed[@]}"
+}
+
+install_packages_from_preferred_repo () {
+ packages="$*"
+ echo "Installing these packages from ${preferred_repo_url}: $packages"
+
+ debs=()
+ # Use "-y --force-yes" to allow downgrading packages with lower versions
+ for deb in $packages
+ do
+ version=$(apt-cache policy "$deb" | grep -B1 "$preferred_repo_url" | head -1 | sed 's/ //g' | cut -d' ' -f1)
+ debs+=("${deb}=${version}")
+ done
+ cmd="apt-get -y --force-yes install ${debs[*]}"
+ echo "Using this command to install the packages from ${preferred_repo_url}: ${cmd}"
+ $cmd
+}
+
+installed_packages_from_other_repo=$(get_installed_packages_from_other_repo)
+echo "Found these packages installed from a different repo: ${installed_packages_from_other_repo}"
+echo
+
+
+if [ -n "$installed_packages_from_other_repo" ]
+then
+ [[ "$options" == "check" ]] && exit 1
+ install_packages_from_preferred_repo "$installed_packages_from_other_repo"
+else
+ echo "Nothing to install - all packages are installed from ${preferred_repo}."
+fi
diff --git a/files/puppet/modules/pixelated/manifests/apt.pp b/files/puppet/modules/pixelated/manifests/apt.pp
index 76f4697..c6280f5 100644
--- a/files/puppet/modules/pixelated/manifests/apt.pp
+++ b/files/puppet/modules/pixelated/manifests/apt.pp
@@ -3,9 +3,13 @@ class pixelated::apt {
include apt
+ # Use latest packages from i.e. jessie-snapshots (possibly unstable) for
+ # special domains
+
$version = $::domain ? {
/^(staging|dev|unstable)\.pixelated-project\.org$/ => '-snapshots',
- default => '',
+ /^pixelated-project.local$/ => '-snapshots',
+ default => '',
}
apt::sources_list { 'pixelated.list':
@@ -23,4 +27,6 @@ class pixelated::apt {
refreshonly => true,
require => File['/srv/leap/0x287A1542472DC0E3_packages@pixelated-project.org.asc'],
}
+
+ include ::pixelated::apt::install_packages_from_pixelated
}
diff --git a/files/puppet/modules/pixelated/manifests/apt/install_packages_from_pixelated.pp b/files/puppet/modules/pixelated/manifests/apt/install_packages_from_pixelated.pp
new file mode 100644
index 0000000..a9d43af
--- /dev/null
+++ b/files/puppet/modules/pixelated/manifests/apt/install_packages_from_pixelated.pp
@@ -0,0 +1,20 @@
+# Prefer all installed packages from the pixelayed repo
+class pixelated::apt::install_packages_from_pixelated {
+
+ file { '/usr/local/bin/prefer_package_repo.sh':
+ source => 'puppet:///modules/pixelated/prefer_package_repo.sh',
+ owner => 'root',
+ group => 'root',
+ mode => '0755',
+ }
+
+ exec { 'prefer_pixelated_packages':
+ command => '/usr/local/bin/prefer_package_repo.sh',
+ unless => '/usr/local/bin/prefer_package_repo.sh check',
+ require => [
+ Package[ 'leap-keymanager', 'leap-mx', 'soledad-client', 'soledad-server' ],
+ File['/usr/local/bin/prefer_package_repo.sh']
+ ]
+ }
+
+}
diff --git a/files/puppet/modules/pixelated/spec/classes/apt_spec.rb b/files/puppet/modules/pixelated/spec/classes/apt_spec.rb
index 7fe995a..102f658 100644
--- a/files/puppet/modules/pixelated/spec/classes/apt_spec.rb
+++ b/files/puppet/modules/pixelated/spec/classes/apt_spec.rb
@@ -43,4 +43,16 @@ describe 'pixelated::apt' do
it { should contain_apt__sources_list('pixelated.list').
with_content("deb [arch=amd64] http://packages.pixelated-project.org/debian jessie-snapshots main\n") }
end
+
+ context 'vagrant' do
+ let(:facts) do
+ {
+ :domain => 'pixelated-project.local',
+ :lsbdistcodename => 'jessie',
+ }
+ end
+
+ it { should contain_apt__sources_list('pixelated.list').
+ with_content("deb [arch=amd64] http://packages.pixelated-project.org/debian jessie-snapshots main\n") }
+ end
end