From aac4577031728dab84f077b54e461fcb813ac0c3 Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 1 Jul 2014 10:20:24 +0200 Subject: pid issue remains to be solved - revert to sth working We've seen two instances of tapicero running on the production servers. The reason is that we are using two different places for the pid file - one for root and one for a normal user. In this scenario tapicero started by root will not notice the tapicero run as a normal user and vice versa. One idea was to solve this by always using /var/run/pid. However this also requires write privileges to that place which essentially only root has. So let's keep the two different places and just make sure we ALWAYS run tapicero as the same user. --- test/integration/actions_test.rb | 37 +++++++++++++++++++++++++++++++++++++ test/integration/tapicero_test.rb | 37 ------------------------------------- 2 files changed, 37 insertions(+), 37 deletions(-) create mode 100644 test/integration/actions_test.rb delete mode 100644 test/integration/tapicero_test.rb (limited to 'test') diff --git a/test/integration/actions_test.rb b/test/integration/actions_test.rb new file mode 100644 index 0000000..88e3715 --- /dev/null +++ b/test/integration/actions_test.rb @@ -0,0 +1,37 @@ +require_relative '../test_helper.rb' + +class TapiceroTest < Tapicero::IntegrationTest + + def setup + create_user + end + + def teardown + delete_user(true) + end + + def test_creates_user_db + assert user_database + assert user_database.name.start_with?(config.options[:db_prefix]) + assert user_database.info # ensure db exists in couch. + end + + def test_configures_security + assert_equal config.options[:security], user_database.get('_security') + end + + def test_stores_design_docs + assert_equal ['_design/docs', '_design/syncs', '_design/transactions'], + design_docs(user_database).map{|doc| doc["id"]}.sort + end + + def test_cleares_user_db + assert user_database.info # ensure db exists in couch. + delete_user + assert !host.databases.include?(user_database.name) + end + + def design_docs(db) + db.documents(startkey: '_design', endkey: '_design'.succ)["rows"] + end +end diff --git a/test/integration/tapicero_test.rb b/test/integration/tapicero_test.rb deleted file mode 100644 index 88e3715..0000000 --- a/test/integration/tapicero_test.rb +++ /dev/null @@ -1,37 +0,0 @@ -require_relative '../test_helper.rb' - -class TapiceroTest < Tapicero::IntegrationTest - - def setup - create_user - end - - def teardown - delete_user(true) - end - - def test_creates_user_db - assert user_database - assert user_database.name.start_with?(config.options[:db_prefix]) - assert user_database.info # ensure db exists in couch. - end - - def test_configures_security - assert_equal config.options[:security], user_database.get('_security') - end - - def test_stores_design_docs - assert_equal ['_design/docs', '_design/syncs', '_design/transactions'], - design_docs(user_database).map{|doc| doc["id"]}.sort - end - - def test_cleares_user_db - assert user_database.info # ensure db exists in couch. - delete_user - assert !host.databases.include?(user_database.name) - end - - def design_docs(db) - db.documents(startkey: '_design', endkey: '_design'.succ)["rows"] - end -end -- cgit v1.2.3