Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test users db security rules on clustered interface #288

Closed

Conversation

mikewallace1979
Copy link
Contributor

Explicitly test authentication_db security rules when authentication_db is on the clustered interface (5984).

COUCHDB-2452

This commit makes dev/run replace the nodes DB with an empty DB
before adding the nodes doc. This changes the previous behaviour
which was to just try adding the docs and ignore conflicts.

The change makes it possible for a developer to run `dev/run -n 1`
(to spawn a single node cluster) having previously run `dev/run`
(which spawns a three node cluster). Without replacing the nodes
DB the `dev/run -n 1` single-node cluster would still have two
other nodes in the nodes DB and therefore not work correctly.

Note that we explicitly delete each node doc rather than deleting
the whole database because the cluster membership layer gets upset
when the nodes database itself is deleted/recreated.
This commit modifies the _users DB security test so that it tests
the authentication DB against the clustered interface in addition
to the admin interface.

Previously this test was only being run against the admin port.

COUCHDB-2452
The users_db_security.js test will not work against a multi-node
cluster because it relies on config settings being made by the
test code. Because there is no generic way of discovering the
locations of the other nodes on a dev cluster (they may be on
unexpected ports for one reason or another) it is only possible
to guarantee those settings are made on a single node.

This commit therefore forces the users_db_security.js test to run
against a single node cluster by:

 - setting the cluster variables to N=Q=R=W=1
 - excluding the test in the Makefile and running it explicitly
   with `dev/run -n 1`
 - teaching run_on_modified_server to correctly preserve the old
   config settings when nested run_on_modified_server calls are
   made

COUCHDB-2452
@davisp
Copy link
Member

davisp commented Mar 23, 2015

LGTM

@kxepal
Copy link
Member

kxepal commented Mar 25, 2015

@kxepal
Copy link
Member

kxepal commented Oct 26, 2015

Hey @sagelywizard ! Sorry for long time waiting. Could you rebase your PR (and related as well) here, please?

UPD: sorry, wrong autocompletion. @mikewallace1979 ^^^ (:

@mikewallace1979
Copy link
Contributor Author

Oof this was a truly unpleasant piece of work :)

I'll give it a shot and see what fun issues I run into.

@kxepal
Copy link
Member

kxepal commented Oct 27, 2015

@mikewallace1979 yea, sorry for that /:

@asfgit asfgit closed this Jul 26, 2016
@asfgit asfgit deleted the 2452-users-db-security-on-clustered-interface branch July 26, 2016 20:07
lag-linaro pushed a commit to lag-linaro/couchdb that referenced this pull request Oct 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants