Commit Graph

61 Commits

Author SHA1 Message Date
rallytime
2e34277b65 Add '--no-psqlrc' option to new-to-carbon postgres unit test 2016-10-07 16:10:57 -06:00
rallytime
f73bdf55c2 Merge branch '2016.3' into 'carbon'
Conflicts:
  - salt/cloud/clouds/vultrpy.py
  - salt/modules/ini_manage.py
  - salt/states/glance.py
2016-10-07 09:51:21 -06:00
Maxime Guillet
b59c23bef1 Fix one remaining postgresql tests linked to #36787. 2016-10-05 17:05:10 +02:00
Maxime Guillet
8b92ae2061 Fix postgresql tests using position in the argument list of psql.
Some tests use position number in the argument list of psql command
to check their results. As #36787 add one element, next position
in the list must be used.
2016-10-05 16:08:42 +02:00
Maxime Guillet
21f2a17a07 Fix postgresql tests by adding --no-psqlrc option introduced by #36787. 2016-10-05 14:43:02 +02:00
rallytime
d0ec4ead2a Merge branch '2016.3' into 'carbon'
No conflicts.
2016-09-23 08:32:17 -06:00
rallytime
26cf545d03 Merge branch '2016.3' into 'carbon'
Conflicts:
  - salt/utils/gitfs.py
  - tests/unit/modules/disk_test.py
2016-09-16 10:35:49 -06:00
Michael Stella
8b877f014d 'All' grants for PostgreSQL.
This update allows granting privileges on ALL tables or ALL sequences
in a given schema.  Such as:

GRANT SELECT ON ALL TABLES IN SCHEMA public TO 'monkey';
2016-09-15 17:22:08 -04:00
Michael Stella
fbbe9ec571 Quote postgres privilege target names (#36249)
* Quote postgres privilege target names

Postgres lets you put characters in table/database names which you then must
quote.  So we should always quote.

* Updating unit tests

* Also quote role names.

Role names can also have dashes (or others) in them, so we must also quote
them.
2016-09-15 15:12:41 -06:00
rallytime
d679c09e65 Merge branch '2016.3' into 'develop'
Conflicts:
  - salt/config/__init__.py
  - salt/utils/parsers.py
  - tests/unit/config/config_test.py
2016-07-18 10:34:03 -06:00
rallytime
cca9446c37 Various spelling fixes
Fixes #34630
2016-07-16 13:17:09 -06:00
Ő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