Roundup Tracker - Issues

Issue 2550705

test requires "CREATE" privilege on Pg - print creation command required for postgresql admin
Type: rfe Severity: minor
Components: Database Versions: 1.4
Status: new
: : ber, schlatterbeck, tonimueller
Priority: :

Created on 2011-05-30 10:16 by tonimueller, last changed 2019-09-14 14:08 by rouilj.

msg4312 Author: [hidden] (tonimueller) Date: 2011-05-30 10:16
roundup's tests for PostgreSQL seem to require that the
'rounduptest' user has the 'CREATE' privilege:

$ ./
Running unit tests at level 1
Running unit tests from /home/toni/mnt/deb/roundup/roundup-1.4.17/.
/usr/lib/python2.6/dist-packages/pytz/ UserWarning:
Module test was already imported from
+/home/toni/mnt/deb/roundup/roundup-1.4.17/./test/__init__.pyc, but
/usr/lib/pymodules/python2.6 is being added to sys.path
  from pkg_resources import resource_stream
Including anydbm tests
Traceback (most recent call last):
  File "./", line 886, in <module>
  File "./", line 876, in process_args
    bad = main(module_filter, test_filter, libdir)
  File "./", line 668, in main
    runner(files, test_filter, debug)
  File "./", line 586, in runner
    s = get_suite(file)
  File "./", line 511, in get_suite
    return suite_func()
"/home/toni/mnt/deb/roundup/roundup-1.4.17/./test/", line
195, in test_suite
    postgresqlOpener.module.db_nuke(config, 1)
line 48, in db_nuke
    db_command(config, command)
line 73, in db_command
    raise RuntimeError('10 attempts to create database failed')
RuntimeError: 10 attempts to create database failed

It would be better if the test suite could make use of a pre-existing
msg4324 Author: [hidden] (ber) Date: 2011-07-01 15:32
How can we completely, securely empty the database, in case we want
to reuse an existing one?
msg4342 Author: [hidden] (schlatterbeck) Date: 2011-07-15 13:06
This doesn't just happen in the test. The database is dropped and
recreated when you call roundup-admin initialise. So for roundup you
always needed create permission on the database. Maybe someone proposes
a fix (this would be nice for hosting setups where the op doesn't have
create permission).
msg4344 Author: [hidden] (ber) Date: 2011-07-15 14:04
We could print out the commands necessary when doing an initialisation,
so they could be send to the admin. For the tests, I guess it would be 
okay to empty and reuse a database I guess.
Date User Action Args
2019-09-14 14:08:46rouiljsettitle: test requires "CREATE" privilege on Pg -> test requires "CREATE" privilege on Pg - print creation command required for postgresql admin
2011-07-15 14:04:54bersetmessages: + msg4344
2011-07-15 13:06:31schlatterbecksetnosy: + schlatterbeck
messages: + msg4342
2011-07-01 15:32:28bersetnosy: + ber
messages: + msg4324
2011-05-30 10:16:10tonimuellercreate