Őry, Máté
0de5410d18
postgres.db_create: fix handling of empty string ( #33261 )
...
* modules.postgres: fix handling of empty string in db_create
The code responsible for collecting the parameters used in the CREATE
DATABASE query works unexpectedly in case for values which are evaluated
to False as bool, but are not None.
This caused queries with missing rvalues like this one (lc_collate=""):
2016-05-13 16:04:05,243 [salt.loaded.int.module.cmdmod][ERROR ][2990]
stderr: ERROR: syntax error at or near "OWNER"
LINE 1: ..._production" WITH ENCODING = 'utf8' LC_COLLATE = OWNER =
"g...
Please note that proper escaping or a different approach would be needed
here.
* modules.postgres: handle trivial sqli in db_create
* modules.postgres: fix OrderedDict usage
* modules.postgres: quote TABLESPACE too in db_create
2016-05-16 09:27:40 -07:00
Andrew Colin Kissa
f5aa107583
Add tests for data directory init and existance check
2016-01-22 12:15:45 +02:00
Andrew Colin Kissa
efcfb611b2
added postgres execution privileges tests
2015-12-29 10:59:48 +02:00
Andrew Colin Kissa
a826720371
Add PostgreSQL Language management functionality
...
Fixes #29874
2015-12-20 09:37:41 +02:00
Roman Inflianskas
0184ecaba7
[modules/postgres] fix tests
2015-11-02 20:53:18 +03:00
Erik Johnson
71d57248d7
Update postgres unit tests to reflect changes in execution module
2015-10-13 10:52:59 -05:00
Michael Steed
980e799122
py3: fix salt/modules/postgres.py and tests
...
- In db_create(), use an OrderedDict for options. This probably doesn't
matter in production, but a deterministic order makes the unit test
work across python 2 and 3.
- Use six-abstracted StringIO
- Use 0 instead of None as the expected successful return code
- Pass bytes instead of str to hashlib.md5()
2015-06-08 16:08:10 -06:00
Luca Corti
b9b307f5f2
Fix postgres.db_alter test, add test for owner_recurse=True
...
The old db_alter test was probably failing anyway. The new test tests
owner_to is called when owner_recurse is set to true.
2015-04-06 00:19:19 +02:00
Mathieu Le Marec - Pasquet
126e29c3eb
pgsql: fix tests
2015-02-24 21:01:13 +01:00
Pedro Algarvio
e0549ca602
Fix import
2015-01-30 22:25:06 +00:00
Pedro Algarvio
60f215f191
Add from __future__ import absolute_import
2015-01-30 22:25:04 +00:00
Mike Place
68b6815883
Another missed quote
2015-01-08 10:16:02 -07:00
Mike Place
96fdbc474a
Fix postgres test
2015-01-07 22:38:51 -07:00
Mike Place
3830162952
Some expressions are not so regular
2015-01-07 15:53:07 -07:00
Thomas S Hatch
0ea13995de
lint
2014-11-11 10:01:33 -07:00
C. R. Oldham
0303154c31
Update tests to respect changes in postgres module
2014-11-10 14:37:44 -07:00
Thomas S Hatch
d60804a709
lint fixes for #15695
2014-09-12 10:42:35 -06:00
Rodolphe Quiédeville
b4dcc992c5
- salt/modules/postgres.py: add functions to manipulate schemas
...
- salt/states/postgres_schema.py: new states for schemas
- tests/unit/modules/postgres_test.py: add tests on new functions
- tests/unit/states/postgres_test.py: add tests on new functions
2014-09-11 12:17:18 +02:00
Leonids Maslovs
6c3973ec05
WIP 13793 Unit tests fixed
2014-07-15 13:19:07 +03:00
Andrew Hammond
1c6b95b4dc
psql should never prompt for a password
...
No matter if we have been given a password or not, it never makes sense
for psql to interactively prompt for a password. It's better to fail
immediately than to hang because psql is waiting for input that will
never happen.
2014-06-13 17:40:11 -07:00
Pedro Algarvio
ac4c042a55
Fix E8251 unexpected spaces around keyword / parameter equals
2014-04-15 09:51:16 +01:00
Mathieu Le Marec - Pasquet
b62c680b81
salt.modules.postgres: Quote all extension work
...
- Fix regressions in tests introduced by @ticosax (nevermind @ticosax i
also regulary breaks them :p)
- Quote also alters.
2014-03-02 10:17:46 +00:00
John Anderson
e1fa6955ff
Tighten up regex a bit
2014-02-04 11:34:18 -07:00
Mike Place
8a0167e72b
Loosen regex to allow for quoting quirk on Ubuntu 10.x
2014-02-04 18:00:48 +00:00
Pedro Algarvio
69d0f907f9
Make use of the print()
function.
2014-02-03 11:07:43 +00:00
Alexey Ivanov
d23ff3821e
codespell: grammar nazi
...
Run codespell[1] against sources.
[1] https://github.com/lucasdemarchi/codespell
2014-01-26 18:41:28 -08:00
Mathieu Le Marec - Pasquet
276e92c4ea
postgres: fix password encryption handling
2014-01-24 14:01:14 +01:00
Mathieu Le Marec - Pasquet
3fa92b49fb
postgres: Pylint
...
This fixes #9920
2014-01-24 14:01:13 +01:00
Mathieu Le Marec - Pasquet
7039b4c974
postgres: support for extensions
2014-01-21 19:25:35 +01:00
Mathieu Le Marec - Pasquet
47c20d2371
postgres: Group and user managment refactoring:
...
- stick to postgresql create/alter role
- handle and detect correctly all roles updates
- again a whole set of factorization
2014-01-21 19:25:35 +01:00
Amir Pakdel
421a6200bf
Fixed pylint and unit test errors
2014-01-16 09:56:52 -05:00
Mike Place
b8e1ddf4bf
Another swing at fixing Postgres tests.
2013-12-30 13:28:51 -07:00
Mike Place
94591d7e2d
Fix unit tests for Postgres on some platforms
...
* Fix for inconsistent behavior wherein systems will use varying escaping behavior for quotes and double-quotes. (Most notably, Ubuntu 10 for some oddball reason.
* Reformatting.
2013-12-28 17:16:54 -07:00
Mike Place
06810a1597
Update unit test to match PG fix.
2013-12-20 17:24:56 -07:00
Mike Place
6d4a422c20
First-pass unit test coverage for the Postgres execution module.
2013-12-03 19:00:26 -07:00
Pedro Algarvio
d02a2bc224
Include the python encoding file header on tests.
2013-11-27 11:19:24 +00:00
Henrik Holmboe
77fd1acb7f
Change assertEquals to assertEqual
...
According to
http://docs.python.org/2/library/unittest.html#deprecated-aliases
assertEquals is a deprecated alias of assertEqual.
2013-10-24 11:39:04 +02:00
Pedro Algarvio
220aa48e24
Adapted unit.modules.poptgres_test
to use salttesting.mock
2013-08-26 13:00:10 +00:00
Pedro Algarvio
7a5872b498
Updated unit.modules.postgres_test
test suite to use salttesting.helpers.ensure_in_syspath()
2013-06-28 00:13:03 +01:00
Pedro Algarvio
6dfe563ce1
Added support for __main__
execution.
2013-06-28 00:12:57 +01:00
Pedro Algarvio
222be7b446
Make sure every test module is runnable by __main__
.
...
* Double to single quotes
2013-06-28 00:12:56 +01:00
Denis Generalov
1b1a5bd743
fix unit tests
2013-04-05 18:21:33 +04:00
Colton Myers
e277154c18
Fix patch.multiple (wrong order on function defs)
2013-03-21 17:26:12 -06:00
Colton Myers
99d0a34dc2
Define patch.multiple
2013-03-21 17:21:26 -06:00
Colton Myers
d42e9d8b63
Wrap extra Mock() references
2013-03-21 17:09:16 -06:00
Colton Myers
7d6c2ffcd3
Add skipIf decorator
2013-03-21 17:00:53 -06:00
Colton Myers
46f6145310
Remove trailing whitespace and fix PEP8 issues
2013-03-21 16:49:41 -06:00
Colton Myers
d3314e231b
Wrap mock import to avoid ImportErrors
2013-03-21 16:48:18 -06:00
Roberto Aguilar
f3b46d7460
Fixed tabs
2013-03-12 11:20:54 -07:00
Roberto Aguilar
18ba416554
Added default runas for postgres functions.
...
On BSD the default runas user is pgsql, on other systems it's postgres.
2013-03-12 18:10:46 +00:00