{"action":"created","comment":{"url":"https://api.github.com/repos/snapcore/snapd/pulls/comments/176914757","pull_request_review_id":106704860,"id":176914757,"diff_hunk":"@@ -369,32 +369,35 @@ EOF\n         # - uids between classic/core differ\n         # - passwd,shadow on core are read-only\n         # - we cannot add root to extrausers as system passwd is searched first\n-        # So we do:\n-        # - take core passwd without \"root\" as extrausers\n-        # - append root,ubuntu,test to extrausers\n-        # - bind mount extrausers to /etc via custom systemd job\n-        mkdir -p /mnt/system-data/var/lib/extrausers/\n-        touch /mnt/system-data/var/lib/extrausers/sub{uid,gid}\n+        # So we create the user db we need in /root/test-etc/*:\n+        # - take core passwd without \"root\"\n+        # - append root,ubuntu,test there\n+        # - make sure the group matches\n+        # - bind mount /root/test-etc/* to /etc/* via custom systemd job\n+        mkdir -p /mnt/system-data/root/test-etc\n         mkdir -p /mnt/system-data/etc/systemd/system/multi-user.target.wants\n         for f in group gshadow passwd shadow; do\n             # the passwd from core without root\n-            tail -n +2 \"$UNPACKD/etc/$f\" > /mnt/system-data/var/lib/extrausers/$f\n+            tail -n +2 \"$UNPACKD/etc/$f\" > /mnt/system-data/root/test-etc/$f\n             # append this systems root user so that linode can connect\n-            head -n1 /etc/$f >> /mnt/system-data/var/lib/extrausers/$f\n+            head -n1 /etc/$f >> /mnt/system-data/root/test-etc/$f\n             # append ubuntu, test user for the testing\n-            tail -n2 /etc/$f >> /mnt/system-data/var/lib/extrausers/$f\n+            tail -n2 /etc/$f >> /mnt/system-data/root/test-etc/$f\n \n-            # now bind mount those passwd files on boot\n+            # make sure the group is as expected\n+            chgrp --reference \"$UNPACKD/etc/$f\" /mnt/system-data/root/test-etc/$f\n+\n+            # now bind mount read-only those passwd files on boot\n             cat <<EOF > /mnt/system-data/etc/systemd/system/etc-$f.mount\n [Unit]\n-Description=Mount extrausers $f over system $f\n+Description=Mount root/test-etc/$f over system etc/$f\n Before=ssh.service\n \n [Mount]\n-What=/var/lib/extrausers/$f","path":"tests/lib/prepare.sh","position":40,"original_position":40,"commit_id":"a1bf4c93fc4efb96b0073cfd55cd59da31c85b97","original_commit_id":"a1bf4c93fc4efb96b0073cfd55cd59da31c85b97","user":{"login":"zyga","id":784262,"avatar_url":"https://avatars0.githubusercontent.com/u/784262?v=4","gravatar_id":"","url":"https://api.github.com/users/zyga","html_url":"https://github.com/zyga","followers_url":"https://api.github.com/users/zyga/followers","following_url":"https://api.github.com/users/zyga/following{/other_user}","gists_url":"https://api.github.com/users/zyga/gists{/gist_id}","starred_url":"https://api.github.com/users/zyga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyga/subscriptions","organizations_url":"https://api.github.com/users/zyga/orgs","repos_url":"https://api.github.com/users/zyga/repos","events_url":"https://api.github.com/users/zyga/events{/privacy}","received_events_url":"https://api.github.com/users/zyga/received_events","type":"User","site_admin":false},"body":"I take it that something somewhere rips /var/lib/extrausers apart but it doesn't touch /root/test-etc so this just moves our files elsewhere to avoid the problem.","created_at":"2018-03-24T17:19:54Z","updated_at":"2018-03-24T17:21:35Z","html_url":"https://github.com/snapcore/snapd/pull/4928#discussion_r176914757","pull_request_url":"https://api.github.com/repos/snapcore/snapd/pulls/4928","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/comments/176914757"},"html":{"href":"https://github.com/snapcore/snapd/pull/4928#discussion_r176914757"},"pull_request":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/4928"}}},"pull_request":{"url":"https://api.github.com/repos/snapcore/snapd/pulls/4928","id":177243984,"html_url":"https://github.com/snapcore/snapd/pull/4928","diff_url":"https://github.com/snapcore/snapd/pull/4928.diff","patch_url":"https://github.com/snapcore/snapd/pull/4928.patch","issue_url":"https://api.github.com/repos/snapcore/snapd/issues/4928","number":4928,"state":"open","locked":false,"title":"tests: disentangle etc vs extrausers in core tests","user":{"login":"pedronis","id":975757,"avatar_url":"https://avatars1.githubusercontent.com/u/975757?v=4","gravatar_id":"","url":"https://api.github.com/users/pedronis","html_url":"https://github.com/pedronis","followers_url":"https://api.github.com/users/pedronis/followers","following_url":"https://api.github.com/users/pedronis/following{/other_user}","gists_url":"https://api.github.com/users/pedronis/gists{/gist_id}","starred_url":"https://api.github.com/users/pedronis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedronis/subscriptions","organizations_url":"https://api.github.com/users/pedronis/orgs","repos_url":"https://api.github.com/users/pedronis/repos","events_url":"https://api.github.com/users/pedronis/events{/privacy}","received_events_url":"https://api.github.com/users/pedronis/received_events","type":"User","site_admin":false},"body":"This changes how we get the spread root user to work on core, instead of bind mounting /var/lib/extrausers/* over /etc/*,  we setup a separate set of files in /root/test-etc/ and read-only bind mount those instead.\r\n\r\nThe cons of the old approach:\r\n* making /var/lib/extrausers/* the same as /etc/* means all our account related tests were not very realistic\r\n* /etc/passwd etc are read-only on core but /var/lib/extrausers/* is meant to be mutable/mutated and it is by tests and in some cases the bind mount got into a //deleted state","created_at":"2018-03-24T15:53:33Z","updated_at":"2018-03-24T17:21:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"69819b3986cd62d5b6716df2fb86bbbc6fa379e1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/snapcore/snapd/pulls/4928/commits","review_comments_url":"https://api.github.com/repos/snapcore/snapd/pulls/4928/comments","review_comment_url":"https://api.github.com/repos/snapcore/snapd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/snapcore/snapd/issues/4928/comments","statuses_url":"https://api.github.com/repos/snapcore/snapd/statuses/a1bf4c93fc4efb96b0073cfd55cd59da31c85b97","head":{"label":"pedronis:disentangle-etc-vs-extrausers","ref":"disentangle-etc-vs-extrausers","sha":"a1bf4c93fc4efb96b0073cfd55cd59da31c85b97","user":{"login":"pedronis","id":975757,"avatar_url":"https://avatars1.githubusercontent.com/u/975757?v=4","gravatar_id":"","url":"https://api.github.com/users/pedronis","html_url":"https://github.com/pedronis","followers_url":"https://api.github.com/users/pedronis/followers","following_url":"https://api.github.com/users/pedronis/following{/other_user}","gists_url":"https://api.github.com/users/pedronis/gists{/gist_id}","starred_url":"https://api.github.com/users/pedronis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedronis/subscriptions","organizations_url":"https://api.github.com/users/pedronis/orgs","repos_url":"https://api.github.com/users/pedronis/repos","events_url":"https://api.github.com/users/pedronis/events{/privacy}","received_events_url":"https://api.github.com/users/pedronis/received_events","type":"User","site_admin":false},"repo":{"id":45828707,"name":"snappy","full_name":"pedronis/snappy","owner":{"login":"pedronis","id":975757,"avatar_url":"https://avatars1.githubusercontent.com/u/975757?v=4","gravatar_id":"","url":"https://api.github.com/users/pedronis","html_url":"https://github.com/pedronis","followers_url":"https://api.github.com/users/pedronis/followers","following_url":"https://api.github.com/users/pedronis/following{/other_user}","gists_url":"https://api.github.com/users/pedronis/gists{/gist_id}","starred_url":"https://api.github.com/users/pedronis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedronis/subscriptions","organizations_url":"https://api.github.com/users/pedronis/orgs","repos_url":"https://api.github.com/users/pedronis/repos","events_url":"https://api.github.com/users/pedronis/events{/privacy}","received_events_url":"https://api.github.com/users/pedronis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pedronis/snappy","description":"Snappy is the software at the heart of Ubuntu Core.","fork":true,"url":"https://api.github.com/repos/pedronis/snappy","forks_url":"https://api.github.com/repos/pedronis/snappy/forks","keys_url":"https://api.github.com/repos/pedronis/snappy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pedronis/snappy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pedronis/snappy/teams","hooks_url":"https://api.github.com/repos/pedronis/snappy/hooks","issue_events_url":"https://api.github.com/repos/pedronis/snappy/issues/events{/number}","events_url":"https://api.github.com/repos/pedronis/snappy/events","assignees_url":"https://api.github.com/repos/pedronis/snappy/assignees{/user}","branches_url":"https://api.github.com/repos/pedronis/snappy/branches{/branch}","tags_url":"https://api.github.com/repos/pedronis/snappy/tags","blobs_url":"https://api.github.com/repos/pedronis/snappy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pedronis/snappy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pedronis/snappy/git/refs{/sha}","trees_url":"https://api.github.com/repos/pedronis/snappy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pedronis/snappy/statuses/{sha}","languages_url":"https://api.github.com/repos/pedronis/snappy/languages","stargazers_url":"https://api.github.com/repos/pedronis/snappy/stargazers","contributors_url":"https://api.github.com/repos/pedronis/snappy/contributors","subscribers_url":"https://api.github.com/repos/pedronis/snappy/subscribers","subscription_url":"https://api.github.com/repos/pedronis/snappy/subscription","commits_url":"https://api.github.com/repos/pedronis/snappy/commits{/sha}","git_commits_url":"https://api.github.com/repos/pedronis/snappy/git/commits{/sha}","comments_url":"https://api.github.com/repos/pedronis/snappy/comments{/number}","issue_comment_url":"https://api.github.com/repos/pedronis/snappy/issues/comments{/number}","contents_url":"https://api.github.com/repos/pedronis/snappy/contents/{+path}","compare_url":"https://api.github.com/repos/pedronis/snappy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pedronis/snappy/merges","archive_url":"https://api.github.com/repos/pedronis/snappy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pedronis/snappy/downloads","issues_url":"https://api.github.com/repos/pedronis/snappy/issues{/number}","pulls_url":"https://api.github.com/repos/pedronis/snappy/pulls{/number}","milestones_url":"https://api.github.com/repos/pedronis/snappy/milestones{/number}","notifications_url":"https://api.github.com/repos/pedronis/snappy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pedronis/snappy/labels{/name}","releases_url":"https://api.github.com/repos/pedronis/snappy/releases{/id}","deployments_url":"https://api.github.com/repos/pedronis/snappy/deployments","created_at":"2015-11-09T09:40:46Z","updated_at":"2018-03-23T19:32:12Z","pushed_at":"2018-03-24T15:48:40Z","git_url":"git://github.com/pedronis/snappy.git","ssh_url":"git@github.com:pedronis/snappy.git","clone_url":"https://github.com/pedronis/snappy.git","svn_url":"https://github.com/pedronis/snappy","homepage":null,"size":60855,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"snapcore:master","ref":"master","sha":"3bae3f8f2b32808e8b3478edb20198885f5f702f","user":{"login":"snapcore","id":19532717,"avatar_url":"https://avatars1.githubusercontent.com/u/19532717?v=4","gravatar_id":"","url":"https://api.github.com/users/snapcore","html_url":"https://github.com/snapcore","followers_url":"https://api.github.com/users/snapcore/followers","following_url":"https://api.github.com/users/snapcore/following{/other_user}","gists_url":"https://api.github.com/users/snapcore/gists{/gist_id}","starred_url":"https://api.github.com/users/snapcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snapcore/subscriptions","organizations_url":"https://api.github.com/users/snapcore/orgs","repos_url":"https://api.github.com/users/snapcore/repos","events_url":"https://api.github.com/users/snapcore/events{/privacy}","received_events_url":"https://api.github.com/users/snapcore/received_events","type":"Organization","site_admin":false},"repo":{"id":44672744,"name":"snapd","full_name":"snapcore/snapd","owner":{"login":"snapcore","id":19532717,"avatar_url":"https://avatars1.githubusercontent.com/u/19532717?v=4","gravatar_id":"","url":"https://api.github.com/users/snapcore","html_url":"https://github.com/snapcore","followers_url":"https://api.github.com/users/snapcore/followers","following_url":"https://api.github.com/users/snapcore/following{/other_user}","gists_url":"https://api.github.com/users/snapcore/gists{/gist_id}","starred_url":"https://api.github.com/users/snapcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snapcore/subscriptions","organizations_url":"https://api.github.com/users/snapcore/orgs","repos_url":"https://api.github.com/users/snapcore/repos","events_url":"https://api.github.com/users/snapcore/events{/privacy}","received_events_url":"https://api.github.com/users/snapcore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/snapcore/snapd","description":"The snapd and snap tools enable systems to work with .snap files.","fork":false,"url":"https://api.github.com/repos/snapcore/snapd","forks_url":"https://api.github.com/repos/snapcore/snapd/forks","keys_url":"https://api.github.com/repos/snapcore/snapd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/snapcore/snapd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/snapcore/snapd/teams","hooks_url":"https://api.github.com/repos/snapcore/snapd/hooks","issue_events_url":"https://api.github.com/repos/snapcore/snapd/issues/events{/number}","events_url":"https://api.github.com/repos/snapcore/snapd/events","assignees_url":"https://api.github.com/repos/snapcore/snapd/assignees{/user}","branches_url":"https://api.github.com/repos/snapcore/snapd/branches{/branch}","tags_url":"https://api.github.com/repos/snapcore/snapd/tags","blobs_url":"https://api.github.com/repos/snapcore/snapd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/snapcore/snapd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/snapcore/snapd/git/refs{/sha}","trees_url":"https://api.github.com/repos/snapcore/snapd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/snapcore/snapd/statuses/{sha}","languages_url":"https://api.github.com/repos/snapcore/snapd/languages","stargazers_url":"https://api.github.com/repos/snapcore/snapd/stargazers","contributors_url":"https://api.github.com/repos/snapcore/snapd/contributors","subscribers_url":"https://api.github.com/repos/snapcore/snapd/subscribers","subscription_url":"https://api.github.com/repos/snapcore/snapd/subscription","commits_url":"https://api.github.com/repos/snapcore/snapd/commits{/sha}","git_commits_url":"https://api.github.com/repos/snapcore/snapd/git/commits{/sha}","comments_url":"https://api.github.com/repos/snapcore/snapd/comments{/number}","issue_comment_url":"https://api.github.com/repos/snapcore/snapd/issues/comments{/number}","contents_url":"https://api.github.com/repos/snapcore/snapd/contents/{+path}","compare_url":"https://api.github.com/repos/snapcore/snapd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/snapcore/snapd/merges","archive_url":"https://api.github.com/repos/snapcore/snapd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/snapcore/snapd/downloads","issues_url":"https://api.github.com/repos/snapcore/snapd/issues{/number}","pulls_url":"https://api.github.com/repos/snapcore/snapd/pulls{/number}","milestones_url":"https://api.github.com/repos/snapcore/snapd/milestones{/number}","notifications_url":"https://api.github.com/repos/snapcore/snapd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/snapcore/snapd/labels{/name}","releases_url":"https://api.github.com/repos/snapcore/snapd/releases{/id}","deployments_url":"https://api.github.com/repos/snapcore/snapd/deployments","created_at":"2015-10-21T11:51:46Z","updated_at":"2018-03-24T15:06:56Z","pushed_at":"2018-03-24T15:53:34Z","git_url":"git://github.com/snapcore/snapd.git","ssh_url":"git@github.com:snapcore/snapd.git","clone_url":"https://github.com/snapcore/snapd.git","svn_url":"https://github.com/snapcore/snapd","homepage":"","size":61205,"stargazers_count":905,"watchers_count":905,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":227,"mirror_url":null,"archived":false,"open_issues_count":53,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":227,"open_issues":53,"watchers":905,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/4928"},"html":{"href":"https://github.com/snapcore/snapd/pull/4928"},"issue":{"href":"https://api.github.com/repos/snapcore/snapd/issues/4928"},"comments":{"href":"https://api.github.com/repos/snapcore/snapd/issues/4928/comments"},"review_comments":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/4928/comments"},"review_comment":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/4928/commits"},"statuses":{"href":"https://api.github.com/repos/snapcore/snapd/statuses/a1bf4c93fc4efb96b0073cfd55cd59da31c85b97"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"zyga"}}