Merge lp:~freyes/charms/trusty/memcached/lp1525026 into lp:charms/trusty/memcached

Proposed by Felipe Reyes
Status: Superseded
Proposed branch: lp:~freyes/charms/trusty/memcached/lp1525026
Merge into: lp:charms/trusty/memcached
Diff against target: 82 lines (+18/-8)
2 files modified
tests/10_deploy_test.py (+6/-3)
tests/20_deploy_replication_test.py (+12/-5)
To merge this branch: bzr merge lp:~freyes/charms/trusty/memcached/lp1525026
Reviewer Review Type Date Requested Status
Review Queue (community) automated testing Needs Fixing
Adam Israel (community) Needs Fixing
charmers Pending
Review via email: mp+281254@code.launchpad.net

This proposal has been superseded by a proposal from 2016-02-25.

Description of the change

Open firewall to allow non-related machines to connect

memcached charm by default secures their units with ufw, this is intended to
avoid non-related units connect to memcached, because it's a security risk.

This patch makes sure that unit testing scripts have the ability to connect
to memcached, after it's verified that the testing script couldn't connect
the memcached port is open running (ufw insert 1 allow PORT)

make functional_test -> http://paste.ubuntu.com/14143642/

To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #15824 memcached for freyes mp281254
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/15824/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #14769 memcached for freyes mp281254
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/14769/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #8386 memcached for freyes mp281254
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/8386/

Revision history for this message
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-lxc/1921/

review: Needs Fixing (automated testing)
Revision history for this message
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-aws/1901/

review: Needs Fixing (automated testing)
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #16581 memcached for freyes mp281254
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/16581/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #15483 memcached for freyes mp281254
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/15483/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #8507 memcached for freyes mp281254
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/8507/

Revision history for this message
Felipe Reyes (freyes) wrote :

On Sat, 26 Dec 2015 14:39:31 -0000
Review Queue <email address hidden> wrote:

> Review: Needs Fixing automated testing
>
> This item has failed automated testing! Results available here
> http://juju-ci.vapour.ws:8080/job/charm-bundle-test-lxc/1921/

Sadly the logs aren't available anymore, but running locally I got no
errors for LXC

$ bundletester -e lxc
memcached
    charm-proof PASS
    make lint PASS
    make test PASS
    00_setup.sh PASS
    10_deploy_test.py PASS
INFO:deployer.env: Waiting for machine termination
    20_deploy_replication_test.py PASS

PASS: 6 Total: 6 (549.816231 sec)

--
Felipe Reyes
Software Sustaining Engineer @ Canonical
STS Engineering Team
# Email: <email address hidden> (GPG:0x9B1FFF39)
# Phone: +56 9 7640 7887
# Launchpad: ~freyes | IRC: freyes

Revision history for this message
Marco Ceppi (marcoceppi) wrote :

I've requeued the tests

On Tue, Jan 5, 2016 at 2:27 PM Felipe Reyes <email address hidden>
wrote:

> On Sat, 26 Dec 2015 14:39:31 -0000
> Review Queue <email address hidden> wrote:
>
> > Review: Needs Fixing automated testing
> >
> > This item has failed automated testing! Results available here
> > http://juju-ci.vapour.ws:8080/job/charm-bundle-test-lxc/1921/
>
> Sadly the logs aren't available anymore, but running locally I got no
> errors for LXC
>
> $ bundletester -e lxc
> memcached
> charm-proof
> PASS
> make lint
> PASS
> make test
> PASS
> 00_setup.sh
> PASS
> 10_deploy_test.py
> PASS
> INFO:deployer.env: Waiting for machine termination
> 20_deploy_replication_test.py
> PASS
>
> PASS: 6 Total: 6 (549.816231 sec)
>
>
> --
> Felipe Reyes
> Software Sustaining Engineer @ Canonical
> STS Engineering Team
> # Email: <email address hidden> (GPG:0x9B1FFF39)
> # Phone: +56 9 7640 7887
> # Launchpad: ~freyes | IRC: freyes
>
>
> https://code.launchpad.net/~freyes/charms/trusty/memcached/lp1525026/+merge/281254
> You are reviewing the proposed merge of
> lp:~freyes/charms/trusty/memcached/lp1525026 into
> lp:charms/trusty/memcached.
>

Revision history for this message
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-lxc/2079/

review: Needs Fixing (automated testing)
Revision history for this message
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-aws/2059/

review: Needs Fixing (automated testing)
Revision history for this message
Adam Israel (aisrael) wrote :

I ran fresh tests on LXC and Amazon yesterday, and both failed.

I think I fixed the tests on LXC (it works locally for me now), by setting allow-ufw-ip6-softfail = True and removing what looked like a duplicate line calling d.sentry['memcached/0']

https://code.launchpad.net/~aisrael/charms/trusty/memcached/charm-review-fixes

Tests are still failing on Amazon, unfortunately. Here's the bundletester output; I added some extra output in the failure to illustrate what's happening:

http://pastebin.ubuntu.com/14688975/

It looks like it's comparing a private against a public address.

Please let me know if you need any other information or you'd like me to retest.

review: Needs Fixing
Revision history for this message
Review Queue (review-queue) wrote :

The results (PASS) are in and available here: http://juju-ci.vapour.ws:8080/job/charm-bundle-test-lxc/2208/

review: Approve (automated testing)
Revision history for this message
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-aws/2188/

review: Needs Fixing (automated testing)
Revision history for this message
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-lxc/2363/

review: Needs Fixing (automated testing)
Revision history for this message
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-aws/2341/

review: Needs Fixing (automated testing)
72. By Felipe Reyes

Get private-address using 'juju run'

UnitSentry doesn't populate the 'info' dict with the private-address, so
to check if the replication was properly configured in clouds where
private-address is different from the public-address, the former is retrieved
with 'juju run ... unit-get private-address'

Revision history for this message
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-lxc/2450/

review: Needs Fixing (automated testing)

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/10_deploy_test.py'
2--- tests/10_deploy_test.py 2015-02-12 22:13:27 +0000
3+++ tests/10_deploy_test.py 2016-02-25 18:46:04 +0000
4@@ -37,7 +37,7 @@
5 raise
6
7 # Get the sentry for memcached.
8-memcached_unit = d.sentry.unit['memcached/0']
9+memcached_unit = d.sentry['memcached'][0]
10
11 # Test if the memcached service is running.
12
13@@ -70,7 +70,7 @@
14 pass # this is good
15
16 # open memcache to be able to connect from this machine
17-memcached_unit.run('ufw allow {}'.format(memcached_port))
18+memcached_unit.run('ufw insert 1 allow {}'.format(memcached_port))
19
20 try:
21 # Connect to memcached via telnet.
22@@ -109,7 +109,10 @@
23 '{0}:{1} {2}').format(memcached_address, memcached_port, str(e))
24 amulet.raise_status(amulet.FAIL, msg=message)
25 finally:
26- tn.close()
27+ try:
28+ tn.close()
29+ except NameError:
30+ pass
31
32 # Test if the memcached service is configured properly.
33
34
35=== modified file 'tests/20_deploy_replication_test.py'
36--- tests/20_deploy_replication_test.py 2015-02-13 15:20:14 +0000
37+++ tests/20_deploy_replication_test.py 2016-02-25 18:46:04 +0000
38@@ -14,8 +14,12 @@
39 o = line.split()[1]
40 break
41
42- if o != b.info['public-address']:
43- amulet.raise_status(amulet.FAIL, msg='Incorrect replica address')
44+ priv_addr_b, code = b.run('unit-get private-address')
45+ assert code == 0, "unit-get private-address failed, code %s" % code
46+ if o != priv_addr_b:
47+ print('(%s != %s)' % (o, priv_addr_b))
48+ amulet.raise_status(amulet.FAIL, msg=('Incorrect replica address '
49+ '(%s != %s)') % (o, priv_addr_b))
50
51
52 def check_replication(a, b, port):
53@@ -48,7 +52,10 @@
54 message = 'An error occurred communicating with memcached over telnet'
55 amulet.raise_status(amulet.FAIL, msg=message)
56 finally:
57- tn.close()
58+ try:
59+ tn.close()
60+ except NameError:
61+ pass
62
63
64 seconds = 1200
65@@ -76,7 +83,7 @@
66 except:
67 raise
68
69-units = (d.sentry['memcached/0'], d.sentry['memcached/1'])
70+units = (d.sentry['memcached'][0], d.sentry['memcached'][1])
71 memcached_port = configuration.get('tcp-port')
72
73 for memcached_unit in units:
74@@ -84,7 +91,7 @@
75 output, code = memcached_unit.run(command)
76
77 # open memcache to be able to connect from this machine
78- memcached_unit.run('ufw allow {}'.format(memcached_port))
79+ memcached_unit.run('ufw insert 1 allow {}'.format(memcached_port))
80
81 if code != 0:
82 message = 'The ' + command + ' returned %d.' % code

Subscribers

People subscribed via source and target branches