{"action":"created","comment":{"url":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/comments/56992191","id":56992191,"diff_hunk":"@@ -0,0 +1,112 @@\n+# Copyright (c) 2014-2016 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+require_relative 'ciscotest'\n+require_relative '../lib/cisco_node_utils/bridge_domain_vni'\n+\n+include Cisco\n+\n+# TestBridgeDomainVNI - Minitest for bridge domain class.\n+class TestBridgeDomainVNI < CiscoTestCase\n+  @skip_unless_supported = 'bridge_domain_vni'\n+  @@cleaned = false # rubocop:disable Style/ClassVars\n+\n+  def cleanup\n+    remove_all_vlans\n+    remove_all_bridge_domains\n+    BridgeDomainVNI.rangebds.each do |_bd, obj|\n+      obj.destroy\n+    end\n+  end\n+\n+  def setup\n+    super\n+    cleanup unless @@cleaned\n+    @@cleaned = true # rubocop:disable Style/ClassVars\n+  end\n+\n+  def teardown\n+    cleanup unless @@cleaned\n+    super\n+    cleanup\n+  end\n+\n+  def test_single_bd_member_vni\n+    mt_full_interface?\n+    bd = BridgeDomainVNI.new('100')\n+    assert_equal(bd.default_member_vni, bd.member_vni,\n+                 'Error: Bridge-Domain is mapped to different vnis')\n+\n+    vni = '6000'\n+    bd.member_vni = vni\n+    assert_equal(vni, bd.member_vni,\n+                 'Error: Bridge-Domain is mapped to different vnis')\n+\n+    bd.member_vni = ''\n+    assert_equal(bd.default_member_vni, bd.member_vni,\n+                 'Error: Bridge-Domain is mapped to different vnis')\n+\n+    bd.destroy\n+  end\n+\n+  def test_multiple_bd_member_vni\n+    mt_full_interface?\n+    bd = BridgeDomainVNI.new('100-110,150,170-171')\n+    assert_equal(bd.default_member_vni, bd.member_vni,\n+                 'Error: Bridge-Domain is mapped to different vnis')\n+\n+    vni = '6000-6010,6050,5070-5071'","path":"tests/test_bridge_domain_vni.rb","position":69,"original_position":69,"commit_id":"6d6c8475045b584a6d81122782d1bcda334c4f7a","original_commit_id":"6d6c8475045b584a6d81122782d1bcda334c4f7a","user":{"login":"chrisvanheuveln","id":12087548,"avatar_url":"https://avatars.githubusercontent.com/u/12087548?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisvanheuveln","html_url":"https://github.com/chrisvanheuveln","followers_url":"https://api.github.com/users/chrisvanheuveln/followers","following_url":"https://api.github.com/users/chrisvanheuveln/following{/other_user}","gists_url":"https://api.github.com/users/chrisvanheuveln/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisvanheuveln/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisvanheuveln/subscriptions","organizations_url":"https://api.github.com/users/chrisvanheuveln/orgs","repos_url":"https://api.github.com/users/chrisvanheuveln/repos","events_url":"https://api.github.com/users/chrisvanheuveln/events{/privacy}","received_events_url":"https://api.github.com/users/chrisvanheuveln/received_events","type":"User","site_admin":false},"body":"Nit: You could add some whitespace just to ensure that your whitespace cleanup is working.","created_at":"2016-03-22T14:14:21Z","updated_at":"2016-03-22T14:14:21Z","html_url":"https://github.com/cisco/cisco-network-node-utils/pull/302#discussion_r56992191","pull_request_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/302","_links":{"self":{"href":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/comments/56992191"},"html":{"href":"https://github.com/cisco/cisco-network-node-utils/pull/302#discussion_r56992191"},"pull_request":{"href":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/302"}}},"pull_request":{"url":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/302","id":63278867,"html_url":"https://github.com/cisco/cisco-network-node-utils/pull/302","diff_url":"https://github.com/cisco/cisco-network-node-utils/pull/302.diff","patch_url":"https://github.com/cisco/cisco-network-node-utils/pull/302.patch","issue_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/issues/302","number":302,"state":"open","locked":false,"title":"Feature/vxlan bridge domain","user":{"login":"rkorlepa","id":12837062,"avatar_url":"https://avatars.githubusercontent.com/u/12837062?v=3","gravatar_id":"","url":"https://api.github.com/users/rkorlepa","html_url":"https://github.com/rkorlepa","followers_url":"https://api.github.com/users/rkorlepa/followers","following_url":"https://api.github.com/users/rkorlepa/following{/other_user}","gists_url":"https://api.github.com/users/rkorlepa/gists{/gist_id}","starred_url":"https://api.github.com/users/rkorlepa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkorlepa/subscriptions","organizations_url":"https://api.github.com/users/rkorlepa/orgs","repos_url":"https://api.github.com/users/rkorlepa/repos","events_url":"https://api.github.com/users/rkorlepa/events{/privacy}","received_events_url":"https://api.github.com/users/rkorlepa/received_events","type":"User","site_admin":false},"body":"Seperate out member_vni from bridge_domain node util and create a new one which can handle bd range, as member vni is done on a range.And also move the common functions to utils class.\r\nThis also contains the changes to the yaml file, before the getter for name and state was using \"show bridge-domain\", have changed it to \"show run bridge-domain\" a more global cli for better parsing in other platforms.\r\nThis also contains changing the setter for encap profile dot1q, before it was taking in two arguments so moved it to a list.","created_at":"2016-03-17T19:26:22Z","updated_at":"2016-03-22T14:14:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"63112d1492f415a8db353275b8811dfc49bac73a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/302/commits","review_comments_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/302/comments","review_comment_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/issues/302/comments","statuses_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/statuses/6d6c8475045b584a6d81122782d1bcda334c4f7a","head":{"label":"rkorlepa:feature/vxlan_bridge_domain","ref":"feature/vxlan_bridge_domain","sha":"6d6c8475045b584a6d81122782d1bcda334c4f7a","user":{"login":"rkorlepa","id":12837062,"avatar_url":"https://avatars.githubusercontent.com/u/12837062?v=3","gravatar_id":"","url":"https://api.github.com/users/rkorlepa","html_url":"https://github.com/rkorlepa","followers_url":"https://api.github.com/users/rkorlepa/followers","following_url":"https://api.github.com/users/rkorlepa/following{/other_user}","gists_url":"https://api.github.com/users/rkorlepa/gists{/gist_id}","starred_url":"https://api.github.com/users/rkorlepa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkorlepa/subscriptions","organizations_url":"https://api.github.com/users/rkorlepa/orgs","repos_url":"https://api.github.com/users/rkorlepa/repos","events_url":"https://api.github.com/users/rkorlepa/events{/privacy}","received_events_url":"https://api.github.com/users/rkorlepa/received_events","type":"User","site_admin":false},"repo":{"id":51951335,"name":"cisco-network-node-utils","full_name":"rkorlepa/cisco-network-node-utils","owner":{"login":"rkorlepa","id":12837062,"avatar_url":"https://avatars.githubusercontent.com/u/12837062?v=3","gravatar_id":"","url":"https://api.github.com/users/rkorlepa","html_url":"https://github.com/rkorlepa","followers_url":"https://api.github.com/users/rkorlepa/followers","following_url":"https://api.github.com/users/rkorlepa/following{/other_user}","gists_url":"https://api.github.com/users/rkorlepa/gists{/gist_id}","starred_url":"https://api.github.com/users/rkorlepa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkorlepa/subscriptions","organizations_url":"https://api.github.com/users/rkorlepa/orgs","repos_url":"https://api.github.com/users/rkorlepa/repos","events_url":"https://api.github.com/users/rkorlepa/events{/privacy}","received_events_url":"https://api.github.com/users/rkorlepa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rkorlepa/cisco-network-node-utils","description":"","fork":true,"url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils","forks_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/forks","keys_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/teams","hooks_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/hooks","issue_events_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/issues/events{/number}","events_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/events","assignees_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/assignees{/user}","branches_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/branches{/branch}","tags_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/tags","blobs_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/languages","stargazers_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/stargazers","contributors_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/contributors","subscribers_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/subscribers","subscription_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/subscription","commits_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/issues/comments{/number}","contents_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/contents/{+path}","compare_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/merges","archive_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/downloads","issues_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/issues{/number}","pulls_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/labels{/name}","releases_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/releases{/id}","deployments_url":"https://api.github.com/repos/rkorlepa/cisco-network-node-utils/deployments","created_at":"2016-02-17T20:02:38Z","updated_at":"2016-02-17T20:02:39Z","pushed_at":"2016-03-17T19:40:13Z","git_url":"git://github.com/rkorlepa/cisco-network-node-utils.git","ssh_url":"git@github.com:rkorlepa/cisco-network-node-utils.git","clone_url":"https://github.com/rkorlepa/cisco-network-node-utils.git","svn_url":"https://github.com/rkorlepa/cisco-network-node-utils","homepage":null,"size":3205,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"cisco:develop","ref":"develop","sha":"54bc7b050de08a9b3f23810c9118dee8be6a3c43","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":39565196,"name":"cisco-network-node-utils","full_name":"cisco/cisco-network-node-utils","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-node-utils","description":"","fork":false,"url":"https://api.github.com/repos/cisco/cisco-network-node-utils","forks_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/forks","keys_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/teams","hooks_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/hooks","issue_events_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/issues/events{/number}","events_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/events","assignees_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/assignees{/user}","branches_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/branches{/branch}","tags_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/tags","blobs_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/languages","stargazers_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/stargazers","contributors_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/contributors","subscribers_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/subscribers","subscription_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/subscription","commits_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/issues/comments{/number}","contents_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/contents/{+path}","compare_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/merges","archive_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/downloads","issues_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/issues{/number}","pulls_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/labels{/name}","releases_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/releases{/id}","deployments_url":"https://api.github.com/repos/cisco/cisco-network-node-utils/deployments","created_at":"2015-07-23T12:07:39Z","updated_at":"2016-02-01T19:00:12Z","pushed_at":"2016-03-21T23:34:25Z","git_url":"git://github.com/cisco/cisco-network-node-utils.git","ssh_url":"git@github.com:cisco/cisco-network-node-utils.git","clone_url":"https://github.com/cisco/cisco-network-node-utils.git","svn_url":"https://github.com/cisco/cisco-network-node-utils","homepage":null,"size":4462,"stargazers_count":9,"watchers_count":9,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":5,"forks":34,"open_issues":5,"watchers":9,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/302"},"html":{"href":"https://github.com/cisco/cisco-network-node-utils/pull/302"},"issue":{"href":"https://api.github.com/repos/cisco/cisco-network-node-utils/issues/302"},"comments":{"href":"https://api.github.com/repos/cisco/cisco-network-node-utils/issues/302/comments"},"review_comments":{"href":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/302/comments"},"review_comment":{"href":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cisco/cisco-network-node-utils/pulls/302/commits"},"statuses":{"href":"https://api.github.com/repos/cisco/cisco-network-node-utils/statuses/6d6c8475045b584a6d81122782d1bcda334c4f7a"}}}}