{"action":"created","comment":{"url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/comments/46300334","id":46300334,"diff_hunk":"@@ -0,0 +1,142 @@\n+###############################################################################\n+# Copyright (c) 2014-2015 Cisco and/or its affiliates.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#     http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+###############################################################################\n+# TestCase Name:\n+# -------------\n+# network_trunk-Provider-Defaults.rb\n+#\n+# TestCase Prerequisites:\n+# -----------------------\n+# This is a Puppet ROUTEDINTF resource testcase for Puppet Agent on Nexus devices.\n+# The test case assumes the following prerequisites are already satisfied:\n+# A. Populating the HOSTS configuration file with the agent and master\n+# information.\n+# B. Enabling SSH connection prerequisites on the N9K switch based Agent.\n+# C. Starting of Puppet master server on master.\n+# D. Sending to and signing of Puppet agent certificate request on master.\n+#\n+# TestCase:\n+# ---------\n+# This is a ROUTEDINTF resource test that tests for default values for\n+# network_trunk resource when created with 'ensure' => 'present'.\n+#\n+# There are 2 sections to the testcase: Setup, group of teststeps.\n+# The 1st step is the Setup teststep that cleans up the switch state.\n+# Steps 2-4 deal with network_trunk resource creation and its\n+# verification using Puppet Agent and the switch running-config.\n+# Steps 5-7 deal with network_trunk resource deletion and its\n+# verification using Puppet Agent and the switch running-config.\n+#\n+# The testcode checks for exit_codes from Puppet Agent, Vegas shell and\n+# Bash shell command executions. For Vegas shell and Bash shell command\n+# string executions, this is the exit_code convention:\n+# 0 - successful command execution, > 0 - failed command execution.\n+# For Puppet Agent command string executions, this is the exit_code convention:\n+# 0 - no changes have occurred, 1 - errors have occurred,\n+# 2 - changes have occurred, 4 - failures have occurred and\n+# 6 - changes and failures have occurred.\n+# 0 is the default exit_code checked in Beaker::DSL::Helpers::on() method.\n+# The testcode also uses RegExp pattern matching on stdout or output IO\n+# instance attributes of Result object from on() method invocation.\n+#\n+###############################################################################\n+\n+require File.expand_path('../../lib/utilitylib.rb', __FILE__)\n+require File.expand_path('../network_trunklib.rb', __FILE__)\n+\n+result = 'PASS'\n+testheader = 'ROUTEDINTF Resource :: All Attributes Defaults'\n+\n+# @test_name [TestCase] Executes defaults testcase for ROUTEDINTF Resource.\n+test_name \"TestCase :: #{testheader}\" do\n+  # @step [Step] Sets up switch for provider test.\n+  step 'TestStep :: Setup switch for provider test' do\n+    # Define PUPPETMASTER_MANIFESTPATH constant using puppet config cmd.\n+    UtilityLib.set_manifest_path(master, self)\n+\n+    # Expected exit_code is 0 since this is a bash shell cmd.\n+    on(master, NetworkTrunkLib.create_defaults)\n+\n+    # Expected exit_code is 0 since this is a puppet agent cmd with no change.\n+    # Or expected exit_code is 2 since this is a puppet agent cmd with change.\n+    cmd_str = UtilityLib.get_namespace_cmd(agent, UtilityLib::PUPPET_BINPATH +\n+      'agent -t', options)\n+    on(agent, cmd_str, acceptable_exit_codes: [0, 2])","path":"tests/beaker_tests/netdev_stdlib/network_trunk_provider_defaults.rb","position":76,"original_position":76,"commit_id":"be0dc574c162308baa40497c2fa9c7e947fe77d7","original_commit_id":"be0dc574c162308baa40497c2fa9c7e947fe77d7","user":{"login":"mikewiebe","id":12445795,"avatar_url":"https://avatars.githubusercontent.com/u/12445795?v=3","gravatar_id":"","url":"https://api.github.com/users/mikewiebe","html_url":"https://github.com/mikewiebe","followers_url":"https://api.github.com/users/mikewiebe/followers","following_url":"https://api.github.com/users/mikewiebe/following{/other_user}","gists_url":"https://api.github.com/users/mikewiebe/gists{/gist_id}","starred_url":"https://api.github.com/users/mikewiebe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikewiebe/subscriptions","organizations_url":"https://api.github.com/users/mikewiebe/orgs","repos_url":"https://api.github.com/users/mikewiebe/repos","events_url":"https://api.github.com/users/mikewiebe/events{/privacy}","received_events_url":"https://api.github.com/users/mikewiebe/received_events","type":"User","site_admin":false},"body":"If you add the cleanup step above then the only acceptable_exit_code in this case would be 2.","created_at":"2015-12-01T16:26:26Z","updated_at":"2015-12-01T16:26:26Z","html_url":"https://github.com/cisco/cisco-network-puppet-module/pull/93#discussion_r46300334","pull_request_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/93","_links":{"self":{"href":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/comments/46300334"},"html":{"href":"https://github.com/cisco/cisco-network-puppet-module/pull/93#discussion_r46300334"},"pull_request":{"href":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/93"}}},"pull_request":{"url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/93","id":52248898,"html_url":"https://github.com/cisco/cisco-network-puppet-module/pull/93","diff_url":"https://github.com/cisco/cisco-network-puppet-module/pull/93.diff","patch_url":"https://github.com/cisco/cisco-network-puppet-module/pull/93.patch","issue_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/issues/93","number":93,"state":"open","locked":false,"title":"netdev_stdlib network trunk implementation","user":{"login":"tphoney","id":10402706,"avatar_url":"https://avatars.githubusercontent.com/u/10402706?v=3","gravatar_id":"","url":"https://api.github.com/users/tphoney","html_url":"https://github.com/tphoney","followers_url":"https://api.github.com/users/tphoney/followers","following_url":"https://api.github.com/users/tphoney/following{/other_user}","gists_url":"https://api.github.com/users/tphoney/gists{/gist_id}","starred_url":"https://api.github.com/users/tphoney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tphoney/subscriptions","organizations_url":"https://api.github.com/users/tphoney/orgs","repos_url":"https://api.github.com/users/tphoney/repos","events_url":"https://api.github.com/users/tphoney/events{/privacy}","received_events_url":"https://api.github.com/users/tphoney/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-01T11:57:07Z","updated_at":"2015-12-01T16:26:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ffe9ee68c3d8518a99a5d14fbe8a626ad07b204","assignee":{"login":"mikewiebe","id":12445795,"avatar_url":"https://avatars.githubusercontent.com/u/12445795?v=3","gravatar_id":"","url":"https://api.github.com/users/mikewiebe","html_url":"https://github.com/mikewiebe","followers_url":"https://api.github.com/users/mikewiebe/followers","following_url":"https://api.github.com/users/mikewiebe/following{/other_user}","gists_url":"https://api.github.com/users/mikewiebe/gists{/gist_id}","starred_url":"https://api.github.com/users/mikewiebe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikewiebe/subscriptions","organizations_url":"https://api.github.com/users/mikewiebe/orgs","repos_url":"https://api.github.com/users/mikewiebe/repos","events_url":"https://api.github.com/users/mikewiebe/events{/privacy}","received_events_url":"https://api.github.com/users/mikewiebe/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/93/commits","review_comments_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/93/comments","review_comment_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/issues/93/comments","statuses_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/statuses/be0dc574c162308baa40497c2fa9c7e947fe77d7","head":{"label":"cisco:network_trunk","ref":"network_trunk","sha":"be0dc574c162308baa40497c2fa9c7e947fe77d7","user":{"login":"cisco","id":1376999,"avatar_url":"https://avatars.githubusercontent.com/u/1376999?v=3","gravatar_id":"","url":"https://api.github.com/users/cisco","html_url":"https://github.com/cisco","followers_url":"https://api.github.com/users/cisco/followers","following_url":"https://api.github.com/users/cisco/following{/other_user}","gists_url":"https://api.github.com/users/cisco/gists{/gist_id}","starred_url":"https://api.github.com/users/cisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cisco/subscriptions","organizations_url":"https://api.github.com/users/cisco/orgs","repos_url":"https://api.github.com/users/cisco/repos","events_url":"https://api.github.com/users/cisco/events{/privacy}","received_events_url":"https://api.github.com/users/cisco/received_events","type":"Organization","site_admin":false},"repo":{"id":39565139,"name":"cisco-network-puppet-module","full_name":"cisco/cisco-network-puppet-module","owner":{"login":"cisco","id":1376999,"avatar_url":"https://avatars.githubusercontent.com/u/1376999?v=3","gravatar_id":"","url":"https://api.github.com/users/cisco","html_url":"https://github.com/cisco","followers_url":"https://api.github.com/users/cisco/followers","following_url":"https://api.github.com/users/cisco/following{/other_user}","gists_url":"https://api.github.com/users/cisco/gists{/gist_id}","starred_url":"https://api.github.com/users/cisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cisco/subscriptions","organizations_url":"https://api.github.com/users/cisco/orgs","repos_url":"https://api.github.com/users/cisco/repos","events_url":"https://api.github.com/users/cisco/events{/privacy}","received_events_url":"https://api.github.com/users/cisco/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cisco/cisco-network-puppet-module","description":"","fork":false,"url":"https://api.github.com/repos/cisco/cisco-network-puppet-module","forks_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/forks","keys_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/teams","hooks_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/hooks","issue_events_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/issues/events{/number}","events_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/events","assignees_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/assignees{/user}","branches_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/branches{/branch}","tags_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/tags","blobs_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/git/refs{/sha}","trees_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/statuses/{sha}","languages_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/languages","stargazers_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/stargazers","contributors_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/contributors","subscribers_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/subscribers","subscription_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/subscription","commits_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/commits{/sha}","git_commits_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/git/commits{/sha}","comments_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/comments{/number}","issue_comment_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/issues/comments{/number}","contents_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/contents/{+path}","compare_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/merges","archive_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/downloads","issues_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/issues{/number}","pulls_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls{/number}","milestones_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/milestones{/number}","notifications_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/labels{/name}","releases_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/releases{/id}","created_at":"2015-07-23T12:06:48Z","updated_at":"2015-11-16T19:52:07Z","pushed_at":"2015-12-01T16:16:18Z","git_url":"git://github.com/cisco/cisco-network-puppet-module.git","ssh_url":"git@github.com:cisco/cisco-network-puppet-module.git","clone_url":"https://github.com/cisco/cisco-network-puppet-module.git","svn_url":"https://github.com/cisco/cisco-network-puppet-module","homepage":null,"size":1705,"stargazers_count":8,"watchers_count":8,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":5,"forks":20,"open_issues":5,"watchers":8,"default_branch":"develop"}},"base":{"label":"cisco:develop","ref":"develop","sha":"e97f8b49874981cb68e448ee96906472b897a66c","user":{"login":"cisco","id":1376999,"avatar_url":"https://avatars.githubusercontent.com/u/1376999?v=3","gravatar_id":"","url":"https://api.github.com/users/cisco","html_url":"https://github.com/cisco","followers_url":"https://api.github.com/users/cisco/followers","following_url":"https://api.github.com/users/cisco/following{/other_user}","gists_url":"https://api.github.com/users/cisco/gists{/gist_id}","starred_url":"https://api.github.com/users/cisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cisco/subscriptions","organizations_url":"https://api.github.com/users/cisco/orgs","repos_url":"https://api.github.com/users/cisco/repos","events_url":"https://api.github.com/users/cisco/events{/privacy}","received_events_url":"https://api.github.com/users/cisco/received_events","type":"Organization","site_admin":false},"repo":{"id":39565139,"name":"cisco-network-puppet-module","full_name":"cisco/cisco-network-puppet-module","owner":{"login":"cisco","id":1376999,"avatar_url":"https://avatars.githubusercontent.com/u/1376999?v=3","gravatar_id":"","url":"https://api.github.com/users/cisco","html_url":"https://github.com/cisco","followers_url":"https://api.github.com/users/cisco/followers","following_url":"https://api.github.com/users/cisco/following{/other_user}","gists_url":"https://api.github.com/users/cisco/gists{/gist_id}","starred_url":"https://api.github.com/users/cisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cisco/subscriptions","organizations_url":"https://api.github.com/users/cisco/orgs","repos_url":"https://api.github.com/users/cisco/repos","events_url":"https://api.github.com/users/cisco/events{/privacy}","received_events_url":"https://api.github.com/users/cisco/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cisco/cisco-network-puppet-module","description":"","fork":false,"url":"https://api.github.com/repos/cisco/cisco-network-puppet-module","forks_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/forks","keys_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/teams","hooks_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/hooks","issue_events_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/issues/events{/number}","events_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/events","assignees_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/assignees{/user}","branches_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/branches{/branch}","tags_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/tags","blobs_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/git/refs{/sha}","trees_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/statuses/{sha}","languages_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/languages","stargazers_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/stargazers","contributors_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/contributors","subscribers_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/subscribers","subscription_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/subscription","commits_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/commits{/sha}","git_commits_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/git/commits{/sha}","comments_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/comments{/number}","issue_comment_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/issues/comments{/number}","contents_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/contents/{+path}","compare_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/merges","archive_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/downloads","issues_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/issues{/number}","pulls_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls{/number}","milestones_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/milestones{/number}","notifications_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/labels{/name}","releases_url":"https://api.github.com/repos/cisco/cisco-network-puppet-module/releases{/id}","created_at":"2015-07-23T12:06:48Z","updated_at":"2015-11-16T19:52:07Z","pushed_at":"2015-12-01T16:16:18Z","git_url":"git://github.com/cisco/cisco-network-puppet-module.git","ssh_url":"git@github.com:cisco/cisco-network-puppet-module.git","clone_url":"https://github.com/cisco/cisco-network-puppet-module.git","svn_url":"https://github.com/cisco/cisco-network-puppet-module","homepage":null,"size":1705,"stargazers_count":8,"watchers_count":8,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":5,"forks":20,"open_issues":5,"watchers":8,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/93"},"html":{"href":"https://github.com/cisco/cisco-network-puppet-module/pull/93"},"issue":{"href":"https://api.github.com/repos/cisco/cisco-network-puppet-module/issues/93"},"comments":{"href":"https://api.github.com/repos/cisco/cisco-network-puppet-module/issues/93/comments"},"review_comments":{"href":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/93/comments"},"review_comment":{"href":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cisco/cisco-network-puppet-module/pulls/93/commits"},"statuses":{"href":"https://api.github.com/repos/cisco/cisco-network-puppet-module/statuses/be0dc574c162308baa40497c2fa9c7e947fe77d7"}}}}