Commit Graph

257 Commits

Author SHA1 Message Date
Thayne Harbaugh
920f062193 Test that an unknown argument to salt-minion exits with EX_USAGE 2016-06-01 18:21:49 -06:00
Thayne Harbaugh
b5e66ad853 Test that a non-existent user for salt-minion exits with EX_NOUSER
Add common exit status assert function.
2016-06-01 18:21:49 -06:00
Drew Adams
bcd6a1cd77 fix osfamily from Suse to SUSE 2016-05-26 22:08:40 -07:00
Nicole Thomas
457d9dd4f5 [develop] Merge forward from 2016.3 to develop (#33193)
* Add run_on_start docs to schedule.rst (#32958)

Fixes #22580

* Backport #33021 manually to 2015.5 (#33044)

* Saltfile with pillar tests (#33045)

* add file.managed with pillar data tests

* do not require git for other tests

* Fix minor document error of test.assertion (#33067)

* test pillar.items output (#33060)

* File and User test fixes for 2015.5 on Fedora23 (#33055)

* Fix file_test.test_symlink on 2015.5

* Fix failing user present test

* add test for installing package while using salt-call --local (#33025)

* add test for installing package while using salt-call --local

* fix pylint

* ssh docs: install py-2.6 for RHEL 5

* Bugfix: Restore boolean values from the repo configuration

* Add test data for repos

* Add repo config test

* Bugfix (follow-up): setting priority requires non-positive integer

* modules.npm: do not log npm --version at info level (#33084)

* salt-cloud: fix ipv6-only virtual machines (#32865)

* salt-cloud: fix ipv6-only virtual machines

* fix hostname for rsync fallback in scp_file function

* use 4 spaces instead of 2

* remove global variable, use direct socket call instead

* Use saltstack repo in buildpackage.py on CentOS 5 (#33080)

* Lower display of msgpack failure msg to debug (#33078)

Closes #33074

* cloud.query needs to define mapper.opts (#33098)

* clarify docs that map is designed to be run once. is not stateful (#33102)

* Moved _finger_fail method to parent class.

Method _finger_fail method from SAuth to AsyncAuth class to make method available
in both class and fix an issue where _finger_Fail is called inside AsyncAuth.

* Fix 33058 (#33099)

* Fix servermanager module

- Added check for 2008 version of windows
- Added Import-Module ServerManager to _pshell_json.
  Apparently this needs to run each time we issue a
  servermanager command.

* Fix list_available

* salt.utils.gitfs: fix formatting for warning messages (#33064)

* salt.utils.gitfs: fix formatting for warning messages

When git_pillar support was added to salt.utils.gitfs, the
recommendation globals had string formatting placeholders added to them,
but the locations where these values are referenced do not call
``.format()`` to properly replace them. This commit fixes that
oversight.

* Remove more gitfs and master-specific wording from log messages

* Add a check that the cmdline of the found proc matches (#33129)

* Doc mock decorators (#33132)

* Add mock function for mocking decorators

* Mock the stdlib user module because importing it will open the repl

* Fix broken parsing of usermgmt.conf on OpenBSD (#33135)

When creating a new user, if a group of the same name already exists,
the usermgmt.conf file is consulted to determine the primary group.
It's in these cases that the parsing bug is triggered.

This code change addresses several of the existing issues:

- The previous split statement explicitly specified a single space.
  Since a config line may have any number of spaces and/or tabs
  surrounding the entries, the resulting array's elements may be
  incorrect.

- According to the man pages for usermgmt.conf, the "group" config
  entry accpets a single parameter -- so we shouldn't iterate.

- The "val[1]" was returning the 2nd letter of each word and not the
  second word on the config line as intended.

* Move salt-ssh thin dir location to /var/tmp (#33130)

* Move salt-ssh thin dir location to /var/tmp

Closes #32771

* Remove performance penelty language

* If cache_jobs: True is set, populate the local job cache when running salt-call (#33100)

* If cache_jobs: True is set, populate the local job cache

Fixes #32834

Allows a masterless minion to query the job cache.

* Refactor cache_jobs functionality to be DRY

* Skipping salt-call --local test

* Back-port #31769 to 2015.8 (#33139)

* Handle empty acl_name in linux_acl state

Calls to setfacl interpret an empty group or user name to mean to be the
owner of the file they're operating on. For example, for a directory
owned by group 'admin', the ACL 'default:group::rwx' is equivalent to
'default:group:admin:rwx'.

The output of the getfacl execution module returns ACLs in the format of
'group:admin:rwx' instead of 'group::rwx'. This commit changes the
acl.present state to look for the owner of the file if the acl_name
paremeter is empty.

* Fix acl.present/acl.absent changing default ACLs

The behaviour of the acl.present and acl.absent is to check the data
structure returned by getfacl contains a key by the name of acl_type.

However, this data structure does not contain any default ACLs if none
exist, so this check will fail. We omit the check if a default ACL was
passed into the state functions.

Unfortunately, the call to modfacl may fail if the user passes in an
acl_type such as 'default:random'. In this case the state will appear to
succeed, but do nothing.

This fixes the state module to allow setting default ACLs on files which
have none.

* Fix regression in 2016.3 HEAD when version is specified (#33146)

Resolves #33013.

* Hash fileclients by opts (#33142)

* Hash fileclients by opts

There was an issue whereby the cache of the fileclient was being overwritten
by dueling minion instances in multimaster mode. This protects them by hashing
by the id of opts.

Closes #25040

* Silly typo!

* Remove tests which do not test any actual functionality or are too tightly coupled to the implementation

* Strip ldap fqdn (#33127)

* Add option to strip off domain names on computer names that come from LDAP/AD

* Add strip_domains option for ldap.

* Add documentation for auth.ldap.minion_stripdomains.

* [2015.5] Update to latest bootstrap script v2016.05.10 (#33155)

* [2015.8] Update to latest bootstrap script v2016.05.10 (#33156)

* [2016.3] Update to latest bootstrap script v2016.05.10 (#33157)

* add 2015.5.11 release notes (#33160)

* add 2015.8.9 release notes (#33161)

* Pip fix (#33180)

* fix pip!!

* make it work with old pip as well

* Added resiliency

* Don't need to check, just get the right name

* [2015.5] Update to latest bootstrap script v2016.05.11 (#33185)
2016-05-12 07:53:39 -07:00
plastikos
0efbbcd17f * Improve init script: specifically manage salt configurations rather than arbitrary salt processes (#32666)
* * Improve init script: specifically manage salt configurations rather than arbitrary salt processes

Unfortunately SysV init scripts tend to rummage through PIDs filtering for
appropriate processes to manage.  Unfortunately the filters are usually weak
and don't account for similar processes run by other users, PIDs of dead
processes being re-used for completely different executables, etc..  These
weaknesses can result in killing unrelated processes with potentially serious
results.

These improvements to the SysV init script is a complete rewrite with the
following improvements:

  * Specifically manage individual salt configurations rather than looking for
    salt minion-like processes.
  * Obtain salt minion information from the salt configuration - use the
    information to manage the specifically configured process.
  * Drop all of the platform-specific helper functions that allow the
    previously-mentioned weaknesses.

    + Unfortunately this means that the output information may not match the
      specific platform (this could easily be corrected).

  * Now can manage multiple salt processes started by different users

    + Unfortunately starts/stops/restarts as a group and is unable to manage
      them both as a group or as individual processes (this could easily be
      corrected)

The new initscript also allows various control variables to be overridden by
environment variables or through settings put in ``/etc/sysconf/salt`` or
``/etc/default/salt``.

:SALTMINION_DEBUG: Dump each line expansion before execution, output system
                   information on failure.  Default: unset

:SALTMINION_BINDIR: Location of ``salt-minion``, ``salt-call`` and other
                    executables.  Default: ``/usr/bin``

:SALTMINION_SYSCONFDIR: The parent directory for the ``salt`` configuration
                        directory and the ``sysconfig`` or ``default``
                        directory.

* Add lines that went missing in the rebase+squash
2016-05-09 10:57:13 -07:00
Justin Findlay
aac1ae35c5 fix some shell tests for MacOS (#32852)
* auth.pam int test: use unhashed pw for MacOS

* shell tests: strip whitespace from shell return

Similar to 2f1c0cf.

* modules.mac_user.delete: update example for int test

integration.shell.call.CallTest.test_user_delete_kw_output expects this
exact string to be in the doc for user.delete:
```
salt '*' user.delete name remove=True force=True
```
2016-04-26 09:47:35 -06:00
Ch3LL
665468b5e8 fix pylint 2016-03-30 10:28:48 -06:00
Ch3LL
1d46f01389 add more comments 2016-03-29 15:13:07 -06:00
Megan Wilhite
f34008988b add more matcher grains tests with wildcard 2016-03-29 19:59:13 +00:00
rallytime
6360ecd3b3 Merge branch '2015.8' into '2016.3'
Conflicts:
  - salt/cloud/clouds/scaleway.py
  - salt/config/__init__.py
  - salt/log/mixins.py
  - salt/minion.py
  - salt/modules/ps.py
  - salt/utils/decorators/__init__.py
  - salt/utils/schema.py
  - tests/unit/modules/etcd_mod_test.py
  - tests/unit/modules/file_test.py
2016-03-18 11:26:12 -06:00
rallytime
35b2076584 Pylint fixes 2016-03-15 14:55:35 -06:00
Justin Findlay
2f1c0cf809 shell tests: strip whitespace from shell return 2016-03-10 10:57:19 -07:00
Justin Findlay
c94dfb870f shell tests: comment on shell return data 2016-03-10 10:57:19 -07:00
Colton Myers
efb479a1bd Merge remote-tracking branch 'upstream/2015.8' into merge-forward-develop
Conflicts:
    doc/topics/cloud/vmware.rst
    salt/cloud/clouds/vmware.py
    salt/grains/chronos.py
    salt/grains/marathon.py
    salt/loader.py
    salt/modules/chronos.py
    salt/modules/marathon.py
    salt/proxy/chronos.py
    salt/proxy/marathon.py
    salt/state.py
    salt/states/chronos_job.py
    salt/states/marathon_app.py
    salt/states/user.py
    salt/utils/schedule.py
2015-11-13 15:18:45 -07:00
Mike Place
785bf94f55 Add transport setting to shell test 2015-11-12 14:32:39 -07:00
Mike Place
9b18f372e6 Normalize IPC check among transports 2015-11-11 16:26:32 -07:00
Thayne Harbaugh
3bedbb713b Use "test.versions" instead of "-g" (pid in grains changes).
integration.shell.call.test_issue_15074_output_file_append test just needs any
output that is repeatable.  Previously it used the grains output ("-g"
argument).  Unfortunately grains now includes the PID which changes for each
invocation of "salt-call" and is therefore not predictably comparable.  Use
"test.versions" that should have constant output across multiple invocations.
2015-11-03 14:10:37 -07:00
Pedro Algarvio
e7681f7c75 Try to overcome a failure to get cwd in Cent tests 2015-07-28 12:07:04 +01:00
Justin Findlay
a95353b4e3 add tcp transport to shell.key tests 2015-07-20 17:02:25 -06:00
Colton Myers
c4f5e231fa Merge remote-tracking branch 'upstream/2015.5' into merge-forward-develop2
Conflicts:
    doc/_themes/saltstack2/layout.html
    doc/conf.py
    doc/index.rst
    doc/ref/modules/all/salt.modules.hipchat.rst
    doc/topics/releases/index.rst
    salt/client/ssh/client.py
    salt/cloud/clouds/vsphere.py
    salt/modules/boto_dynamodb.py
    salt/modules/boto_route53.py
    salt/modules/data.py
    salt/modules/http.py
    salt/modules/tls.py
    salt/output/compact.py
    salt/states/boto_elb.py
    salt/states/linux_acl.py
    salt/states/rabbitmq_user.py
    salt/states/win_servermanager.py
    salt/utils/dictupdate.py
    salt/wheel/config.py
2015-05-29 15:10:13 -06:00
Justin Findlay
6b6280442c disable intermittently failing tests
This commit is to be reverted when #23623 is merged.
2015-05-28 16:23:57 -06:00
Thayne Harbaugh
6f4cfd01fc Specify compound matches as lists
Compound matches, such as nodegroups, can now be specified as lists.  This
avoids splitting on whitespace which may be part of a key or value.

Right now this only works for nodegroups.  Making the argument to "-C"
(compound list) a JSON argument is a future task.
2015-04-24 17:00:04 -06:00
Thayne Harbaugh
993373655a Allow grain and pillar delimiter to be specified in compound matcher syntax. 2015-04-23 23:26:49 -06:00
Thayne Harbaugh
d6fe499f55 Allow compound expressions to begin with "not" 2015-04-22 17:38:17 -06:00
Pedro Algarvio
f7e6f716e3 Make PEP-8 checker happier 2015-04-21 20:35:14 -06:00
Colton Myers
ef583295d5 Merge remote-tracking branch 'upstream/2015.2' into merge-forward-develop
Conflicts:
    salt/beacons/service.py
2015-04-20 11:41:25 -06:00
Thayne Harbaugh
b37b6b2849 Add a test for incorrectly-nested nodegroups that cause a resolution loop. 2015-04-17 17:01:47 -06:00
Thayne Harbaugh
6c1d4d58e9 Fix failure with nested nodegroups:
If a nodegroup was re-used - even if it wasn't a circular reference - it
would fail the nodegroup expansion with the following message:

    Failed nodegroup expansion: illegal nested nodegroup "min"

This was simply because already-visited nodegroups are pushed into `skip`
but were never popped.

   * Add another test case for this situation.
   * Pop the current nodegroup from `skip` when leaving the expansion
     context

Fixes: #22797
2015-04-17 15:20:34 -06:00
rallytime
1e4b93dec9 Python 3 compat fixes for develop 2015-04-17 12:00:01 -06:00
Colton Myers
000de95974 Merge remote-tracking branch 'upstream/2015.2' into merge-forward-develop
Conflicts:
    .pylintrc
    doc/ref/runners/all/salt.runners.nacl.rst
    doc/topics/cloud/config.rst
    salt/cli/salt.py
    salt/client/mixins.py
    salt/client/ssh/__init__.py
    salt/loader.py
    salt/minion.py
    salt/modules/cassandra_cql.py
    salt/modules/gpg.py
    salt/modules/grains.py
    salt/modules/iptables.py
    salt/modules/yumpkg.py
    salt/netapi/rest_cherrypy/app.py
    salt/renderers/pyobjects.py
    salt/returners/mysql.py
    salt/runners/jobs.py
    salt/state.py
    salt/states/file.py
    salt/states/service.py
    salt/utils/minions.py
    tests/integration/__init__.py
    tests/integration/netapi/rest_tornado/test_app.py
    tests/integration/states/cmd.py
2015-04-16 12:15:44 -06:00
Thomas S Hatch
b626149245 fix tests 2015-04-15 11:59:25 -06:00
Colton Myers
5b6d410119 Fix calltest 2015-04-11 15:59:06 -04:00
Colton Myers
99744b9568 Fix lint 2015-04-11 15:56:09 -04:00
Colton Myers
cc8785e980 Fix the test.fib tests 2015-04-11 14:48:59 -04:00
Thayne Harbaugh
1c3536fb8e Support nested nodegroups
Nodegroups can be recursively expanded without worrying about other
compound matcher expansions.  Once the nodegroups are expanded on the
master the remaining flattened compound match can be expanded without the
nodegroup information.
2015-04-08 23:16:39 -06:00
Thomas S Hatch
234cb65a23 Merge pull request #22319 from plastikos/improvement-pillar_pcre
Improvement: add pillar PCRE matching
2015-04-07 09:09:49 -06:00
Thayne Harbaugh
a7a33b381c Various fixes:
* Add missing spaces in help
   * Correct order of arguments to _check_cache_minions() (not part of pillar_pcre)
   * Add platening of pillar_pcre to pillar_exact_minions
   * Add missing match to pillar_pcre
   * Correct unit test
2015-04-03 18:32:52 -06:00
Justin Findlay
fb8b1858a7 shell {en|dis}abled tests for cmdline, templates 2015-04-03 18:08:13 -06:00
Thayne Harbaugh
c91392bc91 Add option -J/--pillar-pcre to match on pillar PCREs 2015-04-03 02:47:19 -06:00
Colton Myers
3c5f9af2d4 Lint (blank lines) 2015-03-21 15:36:04 -06:00
Colton Myers
70406867a4 Merge remote-tracking branch 'upstream/2015.2' into merge-forward-develop
Conflicts:
    salt/client/__init__.py
    salt/modules/file.py
    salt/modules/yumpkg.py
    salt/modules/zypper.py
    tests/integration/shell/auth.py
    tests/unit/states/archive_test.py
    tests/unit/states/module_test.py
2015-03-20 20:09:19 -06:00
Colton Myers
2b1f400ab4 Merge remote-tracking branch 'upstream/2014.7' into merge-forward-2015.2
Conflicts:
    doc/topics/topology/syndic.rst
    salt/client/__init__.py
    salt/daemons/masterapi.py
    salt/minion.py
    salt/modules/dockerio.py
2015-03-19 16:03:29 -06:00
Justin Findlay
f735f0b96d add eauth pam group tests
Adds test for #17380.
2015-03-17 14:25:57 -06:00
Justin Findlay
ebc6a1f4c8 fix matcher tests for 2015.2->develop merge 2015-02-23 15:39:44 -07:00
Colton Myers
c8eb2d4665 Merge remote-tracking branch 'upstream/2015.2' into merge-forward-develop
Conflicts:
	doc/topics/installation/windows.rst
	salt/cloud/clouds/joyent.py
	salt/daemons/flo/core.py
	salt/minion.py
2015-02-23 14:25:51 -07:00
Colton Myers
c3b7be0655 Merge remote-tracking branch 'upstream/2014.7' into merge-forward-2015.2
Conflicts:
	doc/topics/installation/rhel.rst
	salt/output/__init__.py
	salt/utils/__init__.py
2015-02-20 13:51:59 -07:00
Justin Findlay
0d6663b8a8 conform shell integration tests to txt runner 2015-02-17 15:40:17 -07:00
Pedro Algarvio
dc2d3b8ba2 The imports do work! 2015-01-30 22:25:29 +00:00
Pedro Algarvio
788bb913c6 Py3 compatibility fixes. 2015-01-30 22:25:28 +00:00
Pedro Algarvio
8fa37d65eb Py3 compatibility fixes 2015-01-30 22:25:09 +00:00