agendav_dbhost: localhost
agendav_dbport: 5432
agendav_dbopts:
-agendav_dbtty:
agendav_dbuser: postgres
agendav_dbpass:
agendav_dbname: agendav
davical_dbhost: localhost
davical_dbport: 5432
davical_dbopts:
-davical_dbtty:
davical_dbuser: postgres
davical_dbpass:
davical_dbname: davical
postfixadmin_dbhost: localhost
postfixadmin_dbport: 5432
postfixadmin_dbopts:
-postfixadmin_dbtty:
postfixadmin_dbuser: postgres
postfixadmin_dbpass:
postfixadmin_dbname: postfixadmin
roundcube_dbhost: localhost
roundcube_dbport: 5432
roundcube_dbopts:
-roundcube_dbtty:
roundcube_dbuser: postgres
roundcube_dbpass:
roundcube_dbname: roundcube
\fI<plugin>_dbopts\fR (default: empty)
\#
.IP \(bu
-\fI<plugin>_dbtty\fR (default: empty)
-\#
-.IP \(bu
\fI<plugin>_dbuser\fR (default: 'postgres')
\#
.IP \(bu
:host => cfg.agendav_dbhost,
:port => cfg.agendav_dbport,
:options => cfg.agendav_dbopts,
- :tty => cfg.agendav_dbtty,
:dbname => cfg.agendav_dbname,
:user => cfg.agendav_dbuser,
:password => cfg.agendav_dbpass }
d['agendav_dbhost'] = 'localhost'
d['agendav_dbport'] = 5432
d['agendav_dbopts'] = ''
- d['agendav_dbtty'] = ''
d['agendav_dbuser'] = 'postgres'
d['agendav_dbpass'] = ''
d['agendav_dbname'] = 'agendav'
d['davical_dbhost'] = 'localhost'
d['davical_dbport'] = 5432
d['davical_dbopts'] = ''
- d['davical_dbtty'] = ''
d['davical_dbuser'] = 'postgres'
d['davical_dbpass'] = ''
d['davical_dbname'] = 'davical'
d['postfixadmin_dbhost'] = 'localhost'
d['postfixadmin_dbport'] = 5432
d['postfixadmin_dbopts'] = ''
- d['postfixadmin_dbtty'] = ''
d['postfixadmin_dbuser'] = 'postgres'
d['postfixadmin_dbpass'] = ''
d['postfixadmin_dbname'] = 'postfixadmin'
d['roundcube_dbhost'] = 'localhost'
d['roundcube_dbport'] = 5432
d['roundcube_dbopts'] = ''
- d['roundcube_dbtty'] = ''
d['roundcube_dbuser'] = 'postgres'
d['roundcube_dbpass'] = ''
d['roundcube_dbname'] = 'roundcube'
:host => cfg.davical_dbhost,
:port => cfg.davical_dbport,
:options => cfg.davical_dbopts,
- :tty => cfg.davical_dbtty,
:dbname => cfg.davical_dbname,
:user => cfg.davical_dbuser,
:password => cfg.davical_dbpass }
:host => cfg.postfixadmin_dbhost,
:port => cfg.postfixadmin_dbport,
:options => cfg.postfixadmin_dbopts,
- :tty => cfg.postfixadmin_dbtty,
:dbname => cfg.postfixadmin_dbname,
:user => cfg.postfixadmin_dbuser,
:password => cfg.postfixadmin_dbpass }
:host => cfg.roundcube_dbhost,
:port => cfg.roundcube_dbport,
:options => cfg.roundcube_dbopts,
- :tty => cfg.roundcube_dbtty,
:dbname => cfg.roundcube_dbname,
:user => cfg.roundcube_dbuser,
:password => cfg.roundcube_dbpass }
agendav_dbhost: localhost
agendav_dbport: 5432
agendav_dbopts:
-agendav_dbtty:
agendav_dbuser: postgres
agendav_dbpass:
agendav_dbname: agendav_test
davical_dbhost: localhost
davical_dbport: 5432
davical_dbopts:
-davical_dbtty:
davical_dbuser: postgres
davical_dbpass:
davical_dbname: davical_test
postfixadmin_dbhost: localhost
postfixadmin_dbport: 5432
postfixadmin_dbopts:
-postfixadmin_dbtty:
postfixadmin_dbuser: postgres
postfixadmin_dbpass:
postfixadmin_dbname: postfixadmin_test
roundcube_dbhost: localhost
roundcube_dbport: 5432
roundcube_dbopts:
-roundcube_dbtty:
roundcube_dbuser: postgres
roundcube_dbpass:
roundcube_dbname: roundcube_test
# Connect to the database (specified in the test configuration) as
# the superuser. Your local configuration is expected to be such
# that this "just works."
- db_host = 'localhost'
- db_port = 5432
- db_opts = nil
- db_tty = nil
- db_name = 'postgres'
- db_user = 'postgres'
- db_pass = nil
-
- connection = PG::Connection.new(db_host, db_port, db_opts, db_tty,
- db_name, db_user, db_pass)
+ db_hash = {
+ :host => 'localhost',
+ :port => 5432,
+ :options => nil,
+ :dbname => 'postgres',
+ :user => 'postgres',
+ :password => nil
+ }
+ connection = PG::Connection.new(db_hash)
return connection
end
query = "CREATE DATABASE #{plugin_dbname};"
connection.sync_exec(query)
- plugin_dbhost = cfg.send("#{plugin}_dbhost")
- plugin_dbport = cfg.send("#{plugin}_dbport")
- plugin_dbopts = cfg.send("#{plugin}_dbopts")
- plugin_dbtty = cfg.send("#{plugin}_dbtty")
- plugin_dbuser = cfg.send("#{plugin}_dbuser")
- plugin_dbpass = cfg.send("#{plugin}_dbpass")
+ plugin_dbhash = {
+ :host => cfg.send("#{plugin}_dbhost"),
+ :port => cfg.send("#{plugin}_dbport"),
+ :options => cfg.send("#{plugin}_dbopts"),
+ :dbname => plugin_dbname,
+ :user => cfg.send("#{plugin}_dbuser"),
+ :password => cfg.send("#{plugin}_dbpass")
+ }
- plugin_conn = PG::Connection.new(plugin_dbhost, plugin_dbport,
- plugin_dbopts, plugin_dbtty,
- plugin_dbname, plugin_dbuser,
- plugin_dbpass)
+ plugin_conn = PG::Connection.new(plugin_dbhash)
sql = File.open("test/sql/#{plugin}.sql").read()
plugin_conn.sync_exec(sql)