fix(database): don't enforce client encoding
[arvados-formula.git] / test / integration / api / controls / config_spec.rb
index 7ad922f03b4e93eb9dde5510e32ac70936953550..0f64cb2db41911054254551a694875bea9d053e0 100644 (file)
@@ -2,22 +2,42 @@
 
 api_stanza = <<-API_STANZA
     API:
-      RailsSessionSecretToken: "changeme_rails_secret_token"
 API_STANZA
 
 rails_stanza = <<-RAILS_STANZA
       RailsAPI:
         InternalURLs:
-          http://127.0.0.2:8004: {}
+          http://api.internal:8004: {}
 RAILS_STANZA
 
+database_stanza = <<-DATABASE_STANZA
+    ### DATABASE CONFIGURATION
+    PostgreSQL:
+      ConnectionPool: 32
+      Connection:
+        # All parameters here are passed to the PG client library in a connection string;
+        # see https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PARAMKEYWORDS
+        dbname: arvados
+        host: 127.0.0.1
+        password: "changeme_arvados"
+        user: arvados
+        client_encoding: UTF8
+DATABASE_STANZA
+
+group = case os[:name]
+        when 'centos'
+          'nginx'
+        when 'debian', 'ubuntu'
+          'www-data'
+        end
+
 control 'arvados configuration' do
   title 'should match desired api lines'
 
   describe file('/etc/arvados/config.yml') do
     it { should be_file }
     it { should be_owned_by 'root' }
-    it { should be_grouped_into 'www-data' }
+    it { should be_grouped_into group }
     its('mode') { should cmp '0640' }
     its('content') do
       should include(
@@ -26,5 +46,6 @@ control 'arvados configuration' do
     end
     its('content') { should include(api_stanza) }
     its('content') { should include(rails_stanza) }
+    its('content') { should include(database_stanza) }
   end
 end