Commit Graph

289 Commits

Author SHA1 Message Date
Pedro Algarvio
1cae292c68 Fix tests/unit/utils/verify_test.py since verify_user no longer accepts the log argument. 2012-08-11 00:30:13 +01:00
Pedro Algarvio
639471d110 Multi-platform path joiner(appender)
This commit kind of reverts the previous "no more os.sep.join ..." commit by solving the issue which led to switching that code to `os.path.join`. Tested both on linux and windows.
2012-08-08 14:43:34 +01:00
Pedro Algarvio
2faada54d3 Fix the too many open file descriptor issues on 2.6 while running tests. 2012-08-08 09:04:52 +01:00
Pedro Algarvio
2bf0187ae5 Don't close stderr if it's not being used. 2012-08-08 08:18:45 +01:00
Pedro Algarvio
bbfa0b939b One more try travis. 2012-08-08 01:35:36 +01:00
Pedro Algarvio
12007c23a3 Let's see if travis stops failing on 2.6 with "filedescriptor out of range in select()" 2012-08-08 01:21:16 +01:00
Pedro Algarvio
759d67ffc0 Reverted back the --key-logfile deprecation.
On the parsers cleanup branch, I though about making the available options as equal as possible. Since the log_file setting for the master and the minion could be separately set,  I made the logfile option for the key also log_file. Yet, since there's no key specific config file, it shares master, one could only specify the log_file settings from the cli,   it could not be hardcoded on the config file, unless, we made a separate config file just for key.
So, in order to reduce required changes, and keep it all as backwards compatible as possible, the key log file options is now, once again, `--key-logfile` which will allow us to   hardcode it in the masters config file as `key_logfile`.
This will also, hopefully make travis behave better too.
2012-08-08 01:08:38 +01:00
Pedro Algarvio
0b73795310 Merge branch 'develop' of git://github.com/saltstack/salt into develop 2012-08-06 23:05:37 +01:00
Pedro Algarvio
2a7e9500d7 Set the master's logfile to avoid travis failing. 2012-08-06 17:58:30 +01:00
Thomas S Hatch
2355dc3dd4 Merge pull request #1770 from s0undt3ch/master
Make file.touch work on directories and fix some tests when using `--no-clean`
2012-08-06 01:03:49 -07:00
Pedro Algarvio
c89928ec33 Typo. 2012-08-05 19:31:13 +01:00
Pedro Algarvio
a4b96eacfc Corrected last commit line placement. 2012-08-05 19:29:56 +01:00
Pedro Algarvio
dcc0efcd70 Re-add wrongly removed line. 2012-08-05 19:27:28 +01:00
Pedro Algarvio
d01b8da9aa Fix some tests when using --no-clean
When using `--no-clean` while running tests, some files/dirs still need to be removed, if not, test will fail. This commit tries to addresses those issues.
2012-08-05 19:23:12 +01:00
Pedro Algarvio
ac1ee79fa6 Cleanup the salt-run(salt.cli.SaltRun) binary parser.
Reused the timeout mix-in. All cli tools parsers also reuse the config mixin.
This commit finishes cleaning up the cli tool parsers.
2012-08-04 23:25:37 +01:00
Pedro Algarvio
261450e90f Cleanup the salt-call(salt.cli.SaltCall) binary parser.
Reused the logging and output mix-ins.
2012-08-04 23:07:39 +01:00
Pedro Algarvio
060f33a15a Cleanup the salt-key(salt.cli.SaltKey) binary parser.
Reused the output options and logging setup mix-ins.

Fixed a bug introduced in previous commit on `salt.utils.parsers.SaltCPOptionParser._mixin_after_parsed()`, function does not accept any arguments.
2012-08-04 22:55:15 +01:00
Pedro Algarvio
f5aad4f8e2 Cleanup the salt-cp(salt.cli.SaltCP) binary parser.
For this, the timeout mix-in and both the target and output parser group mix-ins were re-used. Way less code and logic to keep track of.
Added a simple test for this binary too.
2012-08-04 22:28:51 +01:00
Pedro Algarvio
b582e40ff1 Cleanup the salt(salt.cli.SaltCMD) binary parser.
* Created 2 mix-ins as option groups, the output options and the target options. This will allow adding some explanatory text besides separating these options from the parser's main options.
* All options on the parser, including the grouped options are now merged to the loaded configuration which will latter get passed on.
* Also created the timeout mix-in which will be used in other binaries.
2012-08-04 22:08:06 +01:00
Pedro Algarvio
d776705e49 Parsers(master, minion, syndic) cleanup code.
Moved the minion, master and syndic parsers to use mixins to clean up, reuse, and automate some of the required procedures.
2012-08-04 19:58:32 +01:00
Pedro Algarvio
6d3028f3da Removed the pip module integration tests since it's also being tested in the virtualenv's integration tests. 2012-08-01 23:11:48 +01:00
Pedro Algarvio
e57f505a2d Fix pip.freeze tests which require an active virtualenv. 2012-08-01 22:40:15 +01:00
Pedro Algarvio
97a4c1dde2 Fix integration/modules/file.py
Since the tests are comparing results, switch to `assertEqual`'s.
2012-08-01 19:36:49 +01:00
Pedro Algarvio
842036b136 Minor cosmetic change while running tests.
Make the salt's printed `~~` lines match the length of the `--` printed lines from unittest.
2012-08-01 19:07:56 +01:00
Pedro Algarvio
7148735b12 Fix virtualenv integration tests.
The virtualenv module needs to have a default for `venv_bin`.
2012-08-01 18:57:31 +01:00
cheater
d07d6b8a7b Adding the gid_from_name parameter to the user.present state 2012-07-30 21:15:35 +02:00
Roman Imankulov
aa5896681d Fix the escaping issue in cmd.run
Lack of escaping in cmd.run with "runas" option could lead to incorrect
execution of commands containing quotes in their bodies.
2012-07-26 22:21:07 +06:00
Roman Imankulov
bc1650a085 Add "mockbin" directory and a fake "su" wrapper for tests
While performing integration tests, the "mockbin" directory is
inserted in the beginning of the $PATH environment variable.

This effectively means that every file placed in this directory will be
executed instead of real one from the system, which opens up the
opportunity to write more complex integration tests.

At the time the only wrapper for "su" command (used in "cmdmod") is
placed there.
2012-07-26 22:14:00 +06:00
Thomas S Hatch
366a4935c1 single quotes 2012-07-23 13:29:55 -06:00
Thomas S Hatch
e61ddfdcfc fix many a test 2012-07-23 13:00:54 -06:00
Intchanter
768e17b9d5 We return tuples, not lists 2012-07-20 08:31:36 -06:00
Roman Imankulov
bb0ed1a3a7 Tests cleanup
Defined "integration.run_tests()" function which can be used to execute
a particular integration test case. Existing bolerplate code in modules
and states tests is replaced with following lines:

    if __name__ == '__main__':
        from integration import run_tests
        run_tests(TestCaseName)

Typical usecase could look like this:

    python integration/modules/pip.py --no-clean -vv
2012-07-20 12:25:08 +06:00
Roman Imankulov
4cac03c42d Add options --clean and --no-clean in runtest.py
--no-clean option speeds up repeating test execution by skipping the cleanup
process before and after testing.

Typical use case command could look like

./runtests.py -vv --no-clean --name integration.modules.ssh
2012-07-20 12:16:14 +06:00
Intchanter
df4a83ac61 Made data.getvals work with CLI, updated test 2012-07-19 21:35:23 -06:00
Thomas S Hatch
8965400ee7 Add consist test to make sure swarm returns are all the same
This is a tool to help hunt down #1386
2012-07-18 13:24:16 -06:00
Jeroen Dekkers
a28272e2fb Fix "undefined name" errors spotted by pyflakes 2012-07-15 03:01:35 +02:00
Intchanter
f663dd2c46 Merge branch 'develop' of https://github.com/saltstack/salt into develop
Conflicts:
	salt/states/network.py
	setup.py
	tests/integration/__init__.py
2012-07-08 22:50:12 -06:00
Thomas S Hatch
e446a306c7 Add sock_dir verification to tests 2012-07-07 22:11:36 -06:00
Thomas S Hatch
7f034cf6ba See if pushing the timeout to insane levels makes travis stop failing 2012-07-05 20:17:04 -06:00
Intchanter
3c05a3ee78 Merge branch 'develop' of https://github.com/saltstack/salt into develop
Conflicts:
	tests/integration/modules/grains.py
	tests/integration/states/host.py
	tests/unit/utils/find_test.py
2012-07-04 18:29:13 -06:00
Intchanter
49b2465cf0 Cleaned up syntax error 2012-07-04 17:42:53 -06:00
Alec Koumjian
a22773bdde Instruct authors of state modules to check for the test parameter 2012-07-03 14:17:52 -07:00
Alec Koumjian
bdb4055ce2 Updating Virtualenv module test with cross-platform file.remove 2012-07-03 08:39:11 -07:00
Dan Colish
b43c256ea7 Adds file.remove to file module, #1545. Drive by spelling correction 2012-07-03 07:50:02 -07:00
Dan Colish
aacd9cc5bd Use getpass.getuser since os.getlogin requires a tty and tests do not
always run with one.
2012-06-30 23:31:01 -07:00
Dan Colish
abf50324d2 Fix integration.module.file tests on linux 2012-06-30 22:47:02 -07:00
Thomas S Hatch
6ac1e176e5 Merge pull request #1548 from laprice/6a63f7c71c39fe442780c192b566e5bcd7f94f42
user creation tests work properly for issue #1482
2012-06-30 17:45:31 -07:00
Dan Colish
71e97d6921 Fix file.chown to report unknown users and groups. Add tests to prove it. 2012-06-30 17:33:34 -07:00
Larry Price
6a63f7c71c Destructive tests now fail properly. 2012-06-30 17:28:48 -07:00
Larry Price
0d1d01fba2 Adding the user creation tests.
These tests will create users on the test machine if you run them as root.
2012-06-30 17:00:27 -07:00