-
Notifications
You must be signed in to change notification settings - Fork 156
Fix Security Tests #595
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
Merged
Merged
Fix Security Tests #595
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
4473e78
Moving JKS and PEM Secured connection tests to use riak-client-tools …
alexmoore abd00b3
Re-enabling security tests for buildbot, fixing directions for local …
alexmoore 0436c21
Clean up Secured Connection tests
alexmoore 5ac9296
Pedantic formatting change
alexmoore 90d9e95
Create resources directory in buildbot makefile
alexmoore 7e5e08c
Fix path for project dir in buildbot makefile
alexmoore a3dea42
Pull tools submodule when building;
alexmoore f0b1eae
Pull tools submodule in for buildbot makefile
alexmoore e73640a
Fix bad revert
alexmoore 677b5ae
Fix dirs again
alexmoore 7f9c05b
Add .gitmodules to repo
alexmoore 32d8b28
Fix dirs
alexmoore 0fc35cc
Create resources directory if not present
alexmoore 3e47f13
Fix security setup in general security tests
alexmoore fbfb0eb
Tweak timing on ClusterFixture Test
alexmoore 5f87698
Adding more debug logging to ssl setup, cleanup security setup in tests.
alexmoore 5b78b3f
Fix SSL Handler race condition
alexmoore 736849e
Revert debug logging for makefile
alexmoore b3b0e7d
Enable debug logging to trace buildbot errors
alexmoore b4eeb47
take out test server host and port
alexmoore 5a3bf0a
Make operation queue test more reliable.
alexmoore 434437f
Enable debug logging to trace tests in buildbot
alexmoore 8eac5c1
Switch buildbot setup script to use riak-client-tools for security se…
alexmoore d9a55e7
Fix maven run path
alexmoore 9812d82
Fix maven run path
alexmoore File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,4 +14,4 @@ nb-configuration.xml | |
| dependency-reduced-pom.xml | ||
| tags | ||
| .java-version | ||
|
|
||
| src/test/resources/* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,54 @@ | ||
|
|
||
| PROJDIR = $(realpath $(CURDIR)/..) | ||
|
|
||
| RESOURCES_DIR = $(PROJDIR)/src/test/resources/ | ||
| TOOLS_DIR = $(PROJDIR)/tools/devrel | ||
| CA_DIR = $(PROJDIR)/tools/test-ca | ||
| CERTS_DIR = $(CA_DIR)/certs | ||
| PRIVATE_DIR = $(CA_DIR)/private | ||
| RIAK_CONF = $(RIAK_DIR)/etc/riak.conf | ||
| ADV_CONF = $(RIAK_DIR)/etc/advanced.config | ||
| RIAK_ADMIN = $(RIAK_DIR)/bin/riak-admin | ||
|
|
||
| preconfigure: | ||
| $(TOOLS_DIR)/gen-riak-conf $(RIAK_CONF) 8098 8087 | ||
| $(TOOLS_DIR)/strong-consistency-conf $(RIAK_CONF) | ||
| preconfigure: configure-security-certs | ||
| $(TOOLS_DIR)/gen-riak-conf $(RIAK_CONF) 8098 8087 18098 $(CERTS_DIR)/cacert.pem $(CERTS_DIR)/riak-test-cert.pem $(PRIVATE_DIR)/riak-test-key.pem | ||
| $(TOOLS_DIR)/gen-adv-conf $(ADV_CONF) | ||
|
|
||
| configure: | ||
| $(TOOLS_DIR)/riak-cluster-config $(RIAK_ADMIN) 8098 true false | ||
| $(TOOLS_DIR)/riak-cluster-config $(RIAK_ADMIN) 8098 true true | ||
|
|
||
| configure-security-certs: | ||
| mkdir -p $(RESOURCES_DIR) | ||
| # Copy certs | ||
| cp $(CERTS_DIR)/cacert.pem $(RESOURCES_DIR) | ||
| cp $(CERTS_DIR)/riak-test-cert.pem $(RESOURCES_DIR) | ||
| cp $(CERTS_DIR)/riakuser-client-cert.pem $(RESOURCES_DIR) | ||
|
|
||
| # PEM Truststore Setup | ||
| openssl pkcs8 -topk8 -inform PEM -outform PEM -in $(PRIVATE_DIR)/riakuser-client-cert-key.pem -out riakuser-client-cert-key_pkcs8.pem -nocrypt | ||
| mv riakuser-client-cert-key_pkcs8.pem $(RESOURCES_DIR) | ||
|
|
||
| # JKS Truststore Setup | ||
| keytool -noprompt -import -trustcacerts -keystore truststore.jks -file $(CERTS_DIR)/cacert.pem -alias cacert -storepass riak123 | ||
| keytool -noprompt -import -trustcacerts -keystore truststore.jks -file $(CERTS_DIR)/riak-test-cert.pem -alias servercert -storepass riak123 | ||
|
|
||
| keytool -importkeystore -srckeystore $(CERTS_DIR)/riakuser-client-cert.pfx -srcstoretype pkcs12 -srcstorepass '' -destkeystore riak_cert_user.jks -deststorepass riak123 -deststoretype JKS | ||
| keytool -noprompt -import -trustcacerts -keystore riak_cert_user.jks -file $(CERTS_DIR)/cacert.pem -alias cacert -storepass riak123 | ||
|
|
||
| mv truststore.jks $(RESOURCES_DIR) | ||
| mv riak_cert_user.jks $(RESOURCES_DIR) | ||
|
|
||
| compile: | ||
| @cd ..; mvn clean compile | ||
| cd ..; mvn clean compile | ||
|
|
||
| lint: | ||
| @echo "No lint task" | ||
|
|
||
| test: test-normal | ||
| test: test-normal test-security | ||
|
|
||
| test-normal: | ||
| @cd ..; mvn -Pitest,default -DargLine="-Dcom.basho.riak.2i=true -Dcom.basho.riak.yokozuna=true -Dcom.basho.riak.buckettype=true -Dcom.basho.riak.crdt=true" verify | ||
| $(RIAK_ADMIN) security disable | ||
| @cd ..; mvn -Pitest,default -Dcom.basho.riak.2i=true -Dcom.basho.riak.yokozuna=true -Dcom.basho.riak.buckettype=true -Dcom.basho.riak.crdt=true verify | ||
|
|
||
| test-security: | ||
| ${RIAK_ADMIN} security add-user tester password=tester | ||
| ${RIAK_ADMIN} security add-source tester 127.0.0.1/32 password | ||
| ${RIAK_ADMIN} security grant riak_kv.get,riak_kv.put,riak_kv.delete,riak_kv.index,riak_kv.list_keys,riak_kv.list_buckets,riak_core.get_bucket,riak_core.set_bucket,riak_core.get_bucket_type,riak_core.set_bucket_type,search.admin,search.query,riak_kv.mapreduce on any to tester | ||
| ${RIAK_ADMIN} security enable | ||
| @cd ..; mvn -Pitest -DargLine="-Dcom.basho.riak.security=true" verify | ||
| $(RIAK_ADMIN) security enable | ||
| @cd ..; mvn -Pitest,test-debug-logging -Dcom.basho.riak.security=true -Dcom.basho.riak.security.clientcert=true test-compile failsafe:integration-test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this blank line :-P