{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/24919","labels_url":"https://api.github.com/repos/saltstack/salt/issues/24919/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/24919/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/24919/events","html_url":"https://github.com/saltstack/salt/pull/24919","id":90567342,"number":24919,"title":"Fix PEP8 complaints & functional testing","user":{"login":"dmyerscough","id":1395617,"avatar_url":"https://avatars.githubusercontent.com/u/1395617?v=3","gravatar_id":"","url":"https://api.github.com/users/dmyerscough","html_url":"https://github.com/dmyerscough","followers_url":"https://api.github.com/users/dmyerscough/followers","following_url":"https://api.github.com/users/dmyerscough/following{/other_user}","gists_url":"https://api.github.com/users/dmyerscough/gists{/gist_id}","starred_url":"https://api.github.com/users/dmyerscough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmyerscough/subscriptions","organizations_url":"https://api.github.com/users/dmyerscough/orgs","repos_url":"https://api.github.com/users/dmyerscough/repos","events_url":"https://api.github.com/users/dmyerscough/events{/privacy}","received_events_url":"https://api.github.com/users/dmyerscough/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Lint","name":"Lint","color":"fef2c0"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Minor%20Change","name":"Minor Change","color":"bfe5bf"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Platform","name":"Platform","color":"fef2c0"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Question","name":"Question","color":"942192"},{"url":"https://api.github.com/repos/saltstack/salt/labels/State%20Module","name":"State Module","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/37","html_url":"https://github.com/saltstack/salt/milestones/Blocked","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/37/labels","id":343741,"number":37,"title":"Blocked","description":"Issues which are blocked in some way, whether they need further discussion, clarification, justification, or are blocked for some other reason.","creator":{"login":"basepi","id":702318,"avatar_url":"https://avatars.githubusercontent.com/u/702318?v=3","gravatar_id":"","url":"https://api.github.com/users/basepi","html_url":"https://github.com/basepi","followers_url":"https://api.github.com/users/basepi/followers","following_url":"https://api.github.com/users/basepi/following{/other_user}","gists_url":"https://api.github.com/users/basepi/gists{/gist_id}","starred_url":"https://api.github.com/users/basepi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basepi/subscriptions","organizations_url":"https://api.github.com/users/basepi/orgs","repos_url":"https://api.github.com/users/basepi/repos","events_url":"https://api.github.com/users/basepi/events{/privacy}","received_events_url":"https://api.github.com/users/basepi/received_events","type":"User","site_admin":false},"open_issues":253,"closed_issues":573,"state":"open","created_at":"2013-05-28T22:24:12Z","updated_at":"2015-06-24T17:12:01Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2015-06-24T05:13:14Z","updated_at":"2015-06-24T17:43:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/saltstack/salt/pulls/24919","html_url":"https://github.com/saltstack/salt/pull/24919","diff_url":"https://github.com/saltstack/salt/pull/24919.diff","patch_url":"https://github.com/saltstack/salt/pull/24919.patch"},"body":"I would like to perform easy functional testing of my states by writing simple sls definitions that actually validate state runs. For example, when I have a state that manages the `/etc/passwd`, we should be able to run a separate test state that validates everything worked as expected.\r\n\r\nExample:-\r\n\r\n/srv/salt/service/accounts/init.sls\r\n```yaml\r\nconfigure_passwd:\r\n  file.managed:\r\n    - name: /etc/passwd\r\n    - mode: '0644'\r\n    - user: root\r\n    - group: root\r\n```\r\n\r\nThe test for this state could be the following:-\r\n\r\n/srv/salt/service/accounts/testing/test_passwd.sls\r\n```yaml\r\ncheck_passwd:\r\n  test.file:\r\n    - name: /etc/passwd\r\n    - mode: '0644'\r\n    - gid: 0\r\n```\r\n\r\nThis test can be manually run or via our CI environment.\r\n\r\n```bash\r\n# salt-call --local state.sls service.accounts.testing.test_passwd\r\nlocal:\r\n----------\r\n          ID: check_passwd\r\n    Function: test.file\r\n        Name: /etc/passwd\r\n      Result: False\r\n     Comment: File mismatch\r\n     Started: 22:00:35.301009\r\n    Duration: 4.51 ms\r\n     Changes:   \r\n              ----------\r\n              actual:\r\n                  ----------\r\n                  gid:\r\n                      10\r\n                  mode:\r\n                      1644\r\n              expected:\r\n                  ----------\r\n                  gid:\r\n                      0\r\n                  mode:\r\n                      0644\r\n\r\nSummary\r\n------------\r\nSucceeded: 0 (changed=1)\r\nFailed:    1\r\n------------\r\nTotal states run:     1\r\n```\r\n\r\nWhat are your thoughts around this?  @cachedout @thatch45 @whiteinge @rallytime"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/114951779","html_url":"https://github.com/saltstack/salt/pull/24919#issuecomment-114951779","issue_url":"https://api.github.com/repos/saltstack/salt/issues/24919","id":114951779,"user":{"login":"dmyerscough","id":1395617,"avatar_url":"https://avatars.githubusercontent.com/u/1395617?v=3","gravatar_id":"","url":"https://api.github.com/users/dmyerscough","html_url":"https://github.com/dmyerscough","followers_url":"https://api.github.com/users/dmyerscough/followers","following_url":"https://api.github.com/users/dmyerscough/following{/other_user}","gists_url":"https://api.github.com/users/dmyerscough/gists{/gist_id}","starred_url":"https://api.github.com/users/dmyerscough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmyerscough/subscriptions","organizations_url":"https://api.github.com/users/dmyerscough/orgs","repos_url":"https://api.github.com/users/dmyerscough/repos","events_url":"https://api.github.com/users/dmyerscough/events{/privacy}","received_events_url":"https://api.github.com/users/dmyerscough/received_events","type":"User","site_admin":false},"created_at":"2015-06-24T17:43:58Z","updated_at":"2015-06-24T17:43:58Z","body":"@cachedout I like that idea :+1: I just need a clean and quick way to perform testing of states. Ill dig around a bit more.\r\n\r\nAre SaltStack working on anything like test-kitchen?"}}