{"action":"created","comment":{"url":"https://api.github.com/repos/projectatomic/docker-storage-setup/pulls/comments/67154788","id":67154788,"diff_hunk":"@@ -0,0 +1,68 @@\n+source $SRCDIR/libtest.sh\n+\n+# Test that the user-specified options stored in\n+# EXTRA_DOCKER_STORAGE_OPTIONS actually end up in \n+# /etc/sysconfig/docker-storage, appended in the string\n+# DOCKER_STORAGE_OPTIONS.\n+test_set_extra_docker_opts() {\n+  local devs=$TEST_DEVS\n+  local test_status\n+  local testname=`basename \"$0\"`\n+  local vg_name\n+  local vg_name=\"dss-test-foo\"\n+  local extra_options=\"--storage-opt dm.fs=ext4\"\n+\n+  # Error out if any pre-existing volume group vg named dss-test-foo\n+  for vg in $(vgs --noheadings -o vg_name); do\n+    if [ \"$vg\" == \"$vg_name\" ]; then\n+      echo \"ERROR: $testname: Volume group $vg_name already exists.\"\n+      return 1\n+    fi\n+  done\n+\n+  # Create config file with Docker storage options\n+  clean_config_files\n+  cat << EOF > /etc/sysconfig/docker-storage-setup\n+DEVS=\"$devs\"\n+VG=$vg_name\n+EXTRA_DOCKER_STORAGE_OPTIONS=\"$extra_options\"\n+EOF\n+  \n+  # Run docker-storage-setup\n+  $DSSBIN >> $LOGS 2>&1 \n+\n+  # d-s-s failed\n+  if [ $? -ne 0 ]; then \n+    cleanup $vg_name \"$devs\"\n+    return $test_status\n+  fi\n+  \n+  test_status=1\n+\n+  # Check /etc/sysconfig/docker-storage to see if \n+  # $EXTRA_DOCKER_STORAGE_OPTIONS was appended to\n+  # DOCKER_STORAGE_OPTIONS in /etc/sysconfig/docker-storage\n+  if [ ! -f /etc/sysconfig/docker-storage ]; then\n+    echo \"ERROR: $testname: docker-storage config file does not exist\"\n+    return $test_status\n+  fi\n+\n+  source /etc/sysconfig/docker-storage\n+  local options=$DOCKER_STORAGE_OPTIONS\n+ \n+  # http://stackoverflow.com/questions/3685970/check-if-an-array-contains-a-value \n+  for opt in $extra_options; do\n+    if [[ ! \"${options[@]}\" =~ \"$opt\" ]]; then\n+      cleanup $vg_name \"$devs\"\n+      return $test_status\n+    fi\n+  done\n+  ","path":"tests/007-test-setting-extra-opts.sh","position":60,"original_position":60,"commit_id":"530ac5b3f9ee3d2991f3a77ee388ed4d60ff8208","original_commit_id":"0cc42244be7e4982cd0976552b5134c443193e8f","user":{"login":"rhvgoyal","id":9487534,"avatar_url":"https://avatars.githubusercontent.com/u/9487534?v=3","gravatar_id":"","url":"https://api.github.com/users/rhvgoyal","html_url":"https://github.com/rhvgoyal","followers_url":"https://api.github.com/users/rhvgoyal/followers","following_url":"https://api.github.com/users/rhvgoyal/following{/other_user}","gists_url":"https://api.github.com/users/rhvgoyal/gists{/gist_id}","starred_url":"https://api.github.com/users/rhvgoyal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhvgoyal/subscriptions","organizations_url":"https://api.github.com/users/rhvgoyal/orgs","repos_url":"https://api.github.com/users/rhvgoyal/repos","events_url":"https://api.github.com/users/rhvgoyal/events{/privacy}","received_events_url":"https://api.github.com/users/rhvgoyal/received_events","type":"User","site_admin":false},"body":"This will test two separate values. dm.fs and ext4. Why not simply use grep  to see if extra_options is part of options or not.","created_at":"2016-06-15T12:50:56Z","updated_at":"2016-06-15T12:50:56Z","html_url":"https://github.com/projectatomic/docker-storage-setup/pull/141#discussion_r67154788","pull_request_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/pulls/141","_links":{"self":{"href":"https://api.github.com/repos/projectatomic/docker-storage-setup/pulls/comments/67154788"},"html":{"href":"https://github.com/projectatomic/docker-storage-setup/pull/141#discussion_r67154788"},"pull_request":{"href":"https://api.github.com/repos/projectatomic/docker-storage-setup/pulls/141"}}},"pull_request":{"url":"https://api.github.com/repos/projectatomic/docker-storage-setup/pulls/141","id":73807819,"html_url":"https://github.com/projectatomic/docker-storage-setup/pull/141","diff_url":"https://github.com/projectatomic/docker-storage-setup/pull/141.diff","patch_url":"https://github.com/projectatomic/docker-storage-setup/pull/141.patch","issue_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/issues/141","number":141,"state":"open","locked":false,"title":"Added new test cases","user":{"login":"stephen679","id":9023630,"avatar_url":"https://avatars.githubusercontent.com/u/9023630?v=3","gravatar_id":"","url":"https://api.github.com/users/stephen679","html_url":"https://github.com/stephen679","followers_url":"https://api.github.com/users/stephen679/followers","following_url":"https://api.github.com/users/stephen679/following{/other_user}","gists_url":"https://api.github.com/users/stephen679/gists{/gist_id}","starred_url":"https://api.github.com/users/stephen679/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephen679/subscriptions","organizations_url":"https://api.github.com/users/stephen679/orgs","repos_url":"https://api.github.com/users/stephen679/repos","events_url":"https://api.github.com/users/stephen679/events{/privacy}","received_events_url":"https://api.github.com/users/stephen679/received_events","type":"User","site_admin":false},"body":"Test cases based off options found in /etc/sysconfig/docker-storage-setup are added. Note: Test 11 and 12 take a bit longer since I have them simulate saturating the pool with data, which of course can be large amounts of data.","created_at":"2016-06-14T20:27:14Z","updated_at":"2016-06-15T12:50:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"96191794ca6084aaafffe91ddaf1cd59a2fb7763","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/pulls/141/commits","review_comments_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/pulls/141/comments","review_comment_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/issues/141/comments","statuses_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/statuses/530ac5b3f9ee3d2991f3a77ee388ed4d60ff8208","head":{"label":"stephen679:test-files","ref":"test-files","sha":"530ac5b3f9ee3d2991f3a77ee388ed4d60ff8208","user":{"login":"stephen679","id":9023630,"avatar_url":"https://avatars.githubusercontent.com/u/9023630?v=3","gravatar_id":"","url":"https://api.github.com/users/stephen679","html_url":"https://github.com/stephen679","followers_url":"https://api.github.com/users/stephen679/followers","following_url":"https://api.github.com/users/stephen679/following{/other_user}","gists_url":"https://api.github.com/users/stephen679/gists{/gist_id}","starred_url":"https://api.github.com/users/stephen679/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephen679/subscriptions","organizations_url":"https://api.github.com/users/stephen679/orgs","repos_url":"https://api.github.com/users/stephen679/repos","events_url":"https://api.github.com/users/stephen679/events{/privacy}","received_events_url":"https://api.github.com/users/stephen679/received_events","type":"User","site_admin":false},"repo":{"id":60645033,"name":"docker-storage-setup","full_name":"stephen679/docker-storage-setup","owner":{"login":"stephen679","id":9023630,"avatar_url":"https://avatars.githubusercontent.com/u/9023630?v=3","gravatar_id":"","url":"https://api.github.com/users/stephen679","html_url":"https://github.com/stephen679","followers_url":"https://api.github.com/users/stephen679/followers","following_url":"https://api.github.com/users/stephen679/following{/other_user}","gists_url":"https://api.github.com/users/stephen679/gists{/gist_id}","starred_url":"https://api.github.com/users/stephen679/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephen679/subscriptions","organizations_url":"https://api.github.com/users/stephen679/orgs","repos_url":"https://api.github.com/users/stephen679/repos","events_url":"https://api.github.com/users/stephen679/events{/privacy}","received_events_url":"https://api.github.com/users/stephen679/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stephen679/docker-storage-setup","description":"A simple service to config docker storage","fork":true,"url":"https://api.github.com/repos/stephen679/docker-storage-setup","forks_url":"https://api.github.com/repos/stephen679/docker-storage-setup/forks","keys_url":"https://api.github.com/repos/stephen679/docker-storage-setup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stephen679/docker-storage-setup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stephen679/docker-storage-setup/teams","hooks_url":"https://api.github.com/repos/stephen679/docker-storage-setup/hooks","issue_events_url":"https://api.github.com/repos/stephen679/docker-storage-setup/issues/events{/number}","events_url":"https://api.github.com/repos/stephen679/docker-storage-setup/events","assignees_url":"https://api.github.com/repos/stephen679/docker-storage-setup/assignees{/user}","branches_url":"https://api.github.com/repos/stephen679/docker-storage-setup/branches{/branch}","tags_url":"https://api.github.com/repos/stephen679/docker-storage-setup/tags","blobs_url":"https://api.github.com/repos/stephen679/docker-storage-setup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stephen679/docker-storage-setup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stephen679/docker-storage-setup/git/refs{/sha}","trees_url":"https://api.github.com/repos/stephen679/docker-storage-setup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stephen679/docker-storage-setup/statuses/{sha}","languages_url":"https://api.github.com/repos/stephen679/docker-storage-setup/languages","stargazers_url":"https://api.github.com/repos/stephen679/docker-storage-setup/stargazers","contributors_url":"https://api.github.com/repos/stephen679/docker-storage-setup/contributors","subscribers_url":"https://api.github.com/repos/stephen679/docker-storage-setup/subscribers","subscription_url":"https://api.github.com/repos/stephen679/docker-storage-setup/subscription","commits_url":"https://api.github.com/repos/stephen679/docker-storage-setup/commits{/sha}","git_commits_url":"https://api.github.com/repos/stephen679/docker-storage-setup/git/commits{/sha}","comments_url":"https://api.github.com/repos/stephen679/docker-storage-setup/comments{/number}","issue_comment_url":"https://api.github.com/repos/stephen679/docker-storage-setup/issues/comments{/number}","contents_url":"https://api.github.com/repos/stephen679/docker-storage-setup/contents/{+path}","compare_url":"https://api.github.com/repos/stephen679/docker-storage-setup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stephen679/docker-storage-setup/merges","archive_url":"https://api.github.com/repos/stephen679/docker-storage-setup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stephen679/docker-storage-setup/downloads","issues_url":"https://api.github.com/repos/stephen679/docker-storage-setup/issues{/number}","pulls_url":"https://api.github.com/repos/stephen679/docker-storage-setup/pulls{/number}","milestones_url":"https://api.github.com/repos/stephen679/docker-storage-setup/milestones{/number}","notifications_url":"https://api.github.com/repos/stephen679/docker-storage-setup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stephen679/docker-storage-setup/labels{/name}","releases_url":"https://api.github.com/repos/stephen679/docker-storage-setup/releases{/id}","deployments_url":"https://api.github.com/repos/stephen679/docker-storage-setup/deployments","created_at":"2016-06-07T20:43:12Z","updated_at":"2016-06-07T20:43:13Z","pushed_at":"2016-06-14T23:13:23Z","git_url":"git://github.com/stephen679/docker-storage-setup.git","ssh_url":"git@github.com:stephen679/docker-storage-setup.git","clone_url":"https://github.com/stephen679/docker-storage-setup.git","svn_url":"https://github.com/stephen679/docker-storage-setup","homepage":null,"size":185,"stargazers_count":0,"watchers_count":0,"language":"Shell","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":"master"}},"base":{"label":"projectatomic:master","ref":"master","sha":"0f1b96bd68add4d5fd3b33f82e2636ab0d775f4b","user":{"login":"projectatomic","id":6852258,"avatar_url":"https://avatars.githubusercontent.com/u/6852258?v=3","gravatar_id":"","url":"https://api.github.com/users/projectatomic","html_url":"https://github.com/projectatomic","followers_url":"https://api.github.com/users/projectatomic/followers","following_url":"https://api.github.com/users/projectatomic/following{/other_user}","gists_url":"https://api.github.com/users/projectatomic/gists{/gist_id}","starred_url":"https://api.github.com/users/projectatomic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectatomic/subscriptions","organizations_url":"https://api.github.com/users/projectatomic/orgs","repos_url":"https://api.github.com/users/projectatomic/repos","events_url":"https://api.github.com/users/projectatomic/events{/privacy}","received_events_url":"https://api.github.com/users/projectatomic/received_events","type":"Organization","site_admin":false},"repo":{"id":25310367,"name":"docker-storage-setup","full_name":"projectatomic/docker-storage-setup","owner":{"login":"projectatomic","id":6852258,"avatar_url":"https://avatars.githubusercontent.com/u/6852258?v=3","gravatar_id":"","url":"https://api.github.com/users/projectatomic","html_url":"https://github.com/projectatomic","followers_url":"https://api.github.com/users/projectatomic/followers","following_url":"https://api.github.com/users/projectatomic/following{/other_user}","gists_url":"https://api.github.com/users/projectatomic/gists{/gist_id}","starred_url":"https://api.github.com/users/projectatomic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectatomic/subscriptions","organizations_url":"https://api.github.com/users/projectatomic/orgs","repos_url":"https://api.github.com/users/projectatomic/repos","events_url":"https://api.github.com/users/projectatomic/events{/privacy}","received_events_url":"https://api.github.com/users/projectatomic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectatomic/docker-storage-setup","description":"A simple service to config docker storage","fork":false,"url":"https://api.github.com/repos/projectatomic/docker-storage-setup","forks_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/forks","keys_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/teams","hooks_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/hooks","issue_events_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/issues/events{/number}","events_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/events","assignees_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/assignees{/user}","branches_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/branches{/branch}","tags_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/tags","blobs_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/statuses/{sha}","languages_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/languages","stargazers_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/stargazers","contributors_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/contributors","subscribers_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/subscribers","subscription_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/subscription","commits_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/contents/{+path}","compare_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/merges","archive_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/downloads","issues_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/issues{/number}","pulls_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/pulls{/number}","milestones_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/milestones{/number}","notifications_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/labels{/name}","releases_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/releases{/id}","deployments_url":"https://api.github.com/repos/projectatomic/docker-storage-setup/deployments","created_at":"2014-10-16T16:11:13Z","updated_at":"2016-06-06T20:54:23Z","pushed_at":"2016-06-14T23:13:24Z","git_url":"git://github.com/projectatomic/docker-storage-setup.git","ssh_url":"git@github.com:projectatomic/docker-storage-setup.git","clone_url":"https://github.com/projectatomic/docker-storage-setup.git","svn_url":"https://github.com/projectatomic/docker-storage-setup","homepage":null,"size":233,"stargazers_count":49,"watchers_count":49,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":29,"forks":39,"open_issues":29,"watchers":49,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/projectatomic/docker-storage-setup/pulls/141"},"html":{"href":"https://github.com/projectatomic/docker-storage-setup/pull/141"},"issue":{"href":"https://api.github.com/repos/projectatomic/docker-storage-setup/issues/141"},"comments":{"href":"https://api.github.com/repos/projectatomic/docker-storage-setup/issues/141/comments"},"review_comments":{"href":"https://api.github.com/repos/projectatomic/docker-storage-setup/pulls/141/comments"},"review_comment":{"href":"https://api.github.com/repos/projectatomic/docker-storage-setup/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projectatomic/docker-storage-setup/pulls/141/commits"},"statuses":{"href":"https://api.github.com/repos/projectatomic/docker-storage-setup/statuses/530ac5b3f9ee3d2991f3a77ee388ed4d60ff8208"}}}}
{"actor":{"display_login":"rhvgoyal"}}