{"action":"created","comment":{"url":"https://api.github.com/repos/os-autoinst/os-autoinst/pulls/comments/85775116","pull_request_review_id":6470406,"id":85775116,"diff_hunk":"@@ -0,0 +1,340 @@\n+#!/usr/bin/perl\n+# This program is free software; you can redistribute it and/or modify\n+# it under the terms of the GNU General Public License as published by\n+# the Free Software Foundation; either version 2 of the License, or\n+# (at your option) any later version.\n+#\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License along\n+# with this program; if not, see <http://www.gnu.org/licenses/>.\n+use 5.018;\n+use warnings;\n+use Carp qw( confess );\n+use English qw( -no_match_vars );\n+use POSIX qw( :sys_wait_h pause );\n+use Socket qw( PF_UNIX SOCK_STREAM sockaddr_un );\n+use Time::HiRes qw( usleep );\n+\n+use Test::More tests => 12;\n+\n+BEGIN {\n+    unshift @INC, '..';\n+}\n+\n+use consoles::virtio_terminal;\n+use testapi ();\n+\n+our $VERSION;\n+\n+my $log_path = './09-terminal-io.log';\n+$testapi::password = 'd*97Jlk/.d';\n+my $socket_path       = './virtio_console';\n+my $login_prompt_data = <<'FIN.';\n+\n+\n+Welcome to SUSE Linux Enterprise Server 12 SP2 RC3 (x86_64) - Kernel 4.4.21-65-default (hvc0).\n+\n+FIN.\n+$login_prompt_data .= 'linux-5rw7 login: ';\n+my $user_name_prompt_data = \"login: \";\n+my $user_name_data        = \"root\\n\";\n+my $password_prompt_data  = 'Password: ';\n+my $password_data         = \"$testapi::password\\n\";\n+# Contains some ANSI/XTERM escape sequences\n+my $first_prompt_data      = \"\\e[1mlinux-5rw7:~ #\\e[0m\\e(B\";\n+my $set_prompt_data        = qq/PS1=\"# \"\\n/;\n+my $normalised_prompt_data = '# ';\n+my $C0_EOT                 = \"\\cD\\cD\";\n+my $C0_ETX                 = \"\\cC\";\n+my $C1_control_code        = qq(\\eQ\\n);\n+my $US_keyboard_data       = <<'FIN.';\n+!@\\#$%^&*()-_+={}[]|:;\"'<>,.?/~`\n+abcdefghijklmnopqrstuwxyz\n+ABCDEFGHIJKLMNOPQRSTUWXYZ\n+0123456789\n+FIN.\n+my $stop_code_data        = \"FIN.\\n\";\n+my $repeat_sequence_count = 1000;\n+my $next_test             = \"GOTO NEXT\\n\";\n+\n+# If test keeps timing out, this can be increased or you can add more calls to\n+# alarm in fake terminal\n+my $timeout = 30;\n+\n+# Either write $msg to the socket or die\n+sub try_write {\n+    my ($fd, $msg) = @_;\n+\n+    open(my $logfd, '>>', $log_path);\n+    print $logfd $msg;\n+    close($logfd);\n+\n+  WRITE: while (1) {","path":"t/09-terminal.t","position":76,"original_position":76,"commit_id":"cd5c2a4fe4cb7ea9b5363a28fd4e4c8fb1f4c9ea","original_commit_id":"cd5c2a4fe4cb7ea9b5363a28fd4e4c8fb1f4c9ea","user":{"login":"aaannz","id":1260795,"avatar_url":"https://avatars.githubusercontent.com/u/1260795?v=3","gravatar_id":"","url":"https://api.github.com/users/aaannz","html_url":"https://github.com/aaannz","followers_url":"https://api.github.com/users/aaannz/followers","following_url":"https://api.github.com/users/aaannz/following{/other_user}","gists_url":"https://api.github.com/users/aaannz/gists{/gist_id}","starred_url":"https://api.github.com/users/aaannz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaannz/subscriptions","organizations_url":"https://api.github.com/users/aaannz/orgs","repos_url":"https://api.github.com/users/aaannz/repos","events_url":"https://api.github.com/users/aaannz/events{/privacy}","received_events_url":"https://api.github.com/users/aaannz/received_events","type":"User","site_admin":false},"body":"For the consistency of codebase I'm for removal of labels and just hide it under plain while-for cycles. Unless really necessary.","created_at":"2016-10-31T16:20:55Z","updated_at":"2016-10-31T16:20:55Z","html_url":"https://github.com/os-autoinst/os-autoinst/pull/637#discussion_r85775116","pull_request_url":"https://api.github.com/repos/os-autoinst/os-autoinst/pulls/637","_links":{"self":{"href":"https://api.github.com/repos/os-autoinst/os-autoinst/pulls/comments/85775116"},"html":{"href":"https://github.com/os-autoinst/os-autoinst/pull/637#discussion_r85775116"},"pull_request":{"href":"https://api.github.com/repos/os-autoinst/os-autoinst/pulls/637"}}},"pull_request":{"url":"https://api.github.com/repos/os-autoinst/os-autoinst/pulls/637","id":91219759,"html_url":"https://github.com/os-autoinst/os-autoinst/pull/637","diff_url":"https://github.com/os-autoinst/os-autoinst/pull/637.diff","patch_url":"https://github.com/os-autoinst/os-autoinst/pull/637.patch","issue_url":"https://api.github.com/repos/os-autoinst/os-autoinst/issues/637","number":637,"state":"open","locked":false,"title":"WIP: Add virtio serial console backend and API","user":{"login":"richiejp","id":988098,"avatar_url":"https://avatars.githubusercontent.com/u/988098?v=3","gravatar_id":"","url":"https://api.github.com/users/richiejp","html_url":"https://github.com/richiejp","followers_url":"https://api.github.com/users/richiejp/followers","following_url":"https://api.github.com/users/richiejp/following{/other_user}","gists_url":"https://api.github.com/users/richiejp/gists{/gist_id}","starred_url":"https://api.github.com/users/richiejp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richiejp/subscriptions","organizations_url":"https://api.github.com/users/richiejp/orgs","repos_url":"https://api.github.com/users/richiejp/repos","events_url":"https://api.github.com/users/richiejp/events{/privacy}","received_events_url":"https://api.github.com/users/richiejp/received_events","type":"User","site_admin":false},"body":"This allows the test writer to log into and interact with a serial\nterminal directly. Initially this is just for the virtio_console under\nQEMU, but can be extended to any serial console.\n\nPresently the only way of sending text to a tty running on a SUT is to\nsend the keystrokes via VNC. Output from the SUT can be redirected to\nand read from, a serial port, however the test writer can not send text\ndirectly to the serial port without circumventing the test API.\n\nThis patch introduces a new console backend which can be selected in the\nsame manner that the existing console backends are, but is limited to\ntext input and output. This means that there is no video feed, but\nentering commands is orders of magnitude faster because the commands are\nsent and interpreted as text rather than simulated keystrokes.\n\nThis adds the is_serial_terminal subroutine to the testapi which is\nexported on request. Otherwise the API should be unchanged and fully\nbackwards compatible.\n","created_at":"2016-10-27T15:05:46Z","updated_at":"2016-10-31T16:20:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"742587258286c0dcc938c8fb1c018f076dc3d7b2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/os-autoinst/os-autoinst/pulls/637/commits","review_comments_url":"https://api.github.com/repos/os-autoinst/os-autoinst/pulls/637/comments","review_comment_url":"https://api.github.com/repos/os-autoinst/os-autoinst/pulls/comments{/number}","comments_url":"https://api.github.com/repos/os-autoinst/os-autoinst/issues/637/comments","statuses_url":"https://api.github.com/repos/os-autoinst/os-autoinst/statuses/cd5c2a4fe4cb7ea9b5363a28fd4e4c8fb1f4c9ea","head":{"label":"richiejp:vioc_rebase","ref":"vioc_rebase","sha":"cd5c2a4fe4cb7ea9b5363a28fd4e4c8fb1f4c9ea","user":{"login":"richiejp","id":988098,"avatar_url":"https://avatars.githubusercontent.com/u/988098?v=3","gravatar_id":"","url":"https://api.github.com/users/richiejp","html_url":"https://github.com/richiejp","followers_url":"https://api.github.com/users/richiejp/followers","following_url":"https://api.github.com/users/richiejp/following{/other_user}","gists_url":"https://api.github.com/users/richiejp/gists{/gist_id}","starred_url":"https://api.github.com/users/richiejp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richiejp/subscriptions","organizations_url":"https://api.github.com/users/richiejp/orgs","repos_url":"https://api.github.com/users/richiejp/repos","events_url":"https://api.github.com/users/richiejp/events{/privacy}","received_events_url":"https://api.github.com/users/richiejp/received_events","type":"User","site_admin":false},"repo":{"id":64208047,"name":"os-autoinst","full_name":"richiejp/os-autoinst","owner":{"login":"richiejp","id":988098,"avatar_url":"https://avatars.githubusercontent.com/u/988098?v=3","gravatar_id":"","url":"https://api.github.com/users/richiejp","html_url":"https://github.com/richiejp","followers_url":"https://api.github.com/users/richiejp/followers","following_url":"https://api.github.com/users/richiejp/following{/other_user}","gists_url":"https://api.github.com/users/richiejp/gists{/gist_id}","starred_url":"https://api.github.com/users/richiejp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richiejp/subscriptions","organizations_url":"https://api.github.com/users/richiejp/orgs","repos_url":"https://api.github.com/users/richiejp/repos","events_url":"https://api.github.com/users/richiejp/events{/privacy}","received_events_url":"https://api.github.com/users/richiejp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/richiejp/os-autoinst","description":"OS-level test automation","fork":true,"url":"https://api.github.com/repos/richiejp/os-autoinst","forks_url":"https://api.github.com/repos/richiejp/os-autoinst/forks","keys_url":"https://api.github.com/repos/richiejp/os-autoinst/keys{/key_id}","collaborators_url":"https://api.github.com/repos/richiejp/os-autoinst/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/richiejp/os-autoinst/teams","hooks_url":"https://api.github.com/repos/richiejp/os-autoinst/hooks","issue_events_url":"https://api.github.com/repos/richiejp/os-autoinst/issues/events{/number}","events_url":"https://api.github.com/repos/richiejp/os-autoinst/events","assignees_url":"https://api.github.com/repos/richiejp/os-autoinst/assignees{/user}","branches_url":"https://api.github.com/repos/richiejp/os-autoinst/branches{/branch}","tags_url":"https://api.github.com/repos/richiejp/os-autoinst/tags","blobs_url":"https://api.github.com/repos/richiejp/os-autoinst/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/richiejp/os-autoinst/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/richiejp/os-autoinst/git/refs{/sha}","trees_url":"https://api.github.com/repos/richiejp/os-autoinst/git/trees{/sha}","statuses_url":"https://api.github.com/repos/richiejp/os-autoinst/statuses/{sha}","languages_url":"https://api.github.com/repos/richiejp/os-autoinst/languages","stargazers_url":"https://api.github.com/repos/richiejp/os-autoinst/stargazers","contributors_url":"https://api.github.com/repos/richiejp/os-autoinst/contributors","subscribers_url":"https://api.github.com/repos/richiejp/os-autoinst/subscribers","subscription_url":"https://api.github.com/repos/richiejp/os-autoinst/subscription","commits_url":"https://api.github.com/repos/richiejp/os-autoinst/commits{/sha}","git_commits_url":"https://api.github.com/repos/richiejp/os-autoinst/git/commits{/sha}","comments_url":"https://api.github.com/repos/richiejp/os-autoinst/comments{/number}","issue_comment_url":"https://api.github.com/repos/richiejp/os-autoinst/issues/comments{/number}","contents_url":"https://api.github.com/repos/richiejp/os-autoinst/contents/{+path}","compare_url":"https://api.github.com/repos/richiejp/os-autoinst/compare/{base}...{head}","merges_url":"https://api.github.com/repos/richiejp/os-autoinst/merges","archive_url":"https://api.github.com/repos/richiejp/os-autoinst/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/richiejp/os-autoinst/downloads","issues_url":"https://api.github.com/repos/richiejp/os-autoinst/issues{/number}","pulls_url":"https://api.github.com/repos/richiejp/os-autoinst/pulls{/number}","milestones_url":"https://api.github.com/repos/richiejp/os-autoinst/milestones{/number}","notifications_url":"https://api.github.com/repos/richiejp/os-autoinst/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/richiejp/os-autoinst/labels{/name}","releases_url":"https://api.github.com/repos/richiejp/os-autoinst/releases{/id}","deployments_url":"https://api.github.com/repos/richiejp/os-autoinst/deployments","created_at":"2016-07-26T09:21:28Z","updated_at":"2016-07-26T09:21:29Z","pushed_at":"2016-10-27T15:04:20Z","git_url":"git://github.com/richiejp/os-autoinst.git","ssh_url":"git@github.com:richiejp/os-autoinst.git","clone_url":"https://github.com/richiejp/os-autoinst.git","svn_url":"https://github.com/richiejp/os-autoinst","homepage":"","size":14616,"stargazers_count":0,"watchers_count":0,"language":"Perl","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":"os-autoinst:master","ref":"master","sha":"0cb7b0574dce2f6fa05bf1c9cd95567fc0d3be25","user":{"login":"os-autoinst","id":6918706,"avatar_url":"https://avatars.githubusercontent.com/u/6918706?v=3","gravatar_id":"","url":"https://api.github.com/users/os-autoinst","html_url":"https://github.com/os-autoinst","followers_url":"https://api.github.com/users/os-autoinst/followers","following_url":"https://api.github.com/users/os-autoinst/following{/other_user}","gists_url":"https://api.github.com/users/os-autoinst/gists{/gist_id}","starred_url":"https://api.github.com/users/os-autoinst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/os-autoinst/subscriptions","organizations_url":"https://api.github.com/users/os-autoinst/orgs","repos_url":"https://api.github.com/users/os-autoinst/repos","events_url":"https://api.github.com/users/os-autoinst/events{/privacy}","received_events_url":"https://api.github.com/users/os-autoinst/received_events","type":"Organization","site_admin":false},"repo":{"id":3034889,"name":"os-autoinst","full_name":"os-autoinst/os-autoinst","owner":{"login":"os-autoinst","id":6918706,"avatar_url":"https://avatars.githubusercontent.com/u/6918706?v=3","gravatar_id":"","url":"https://api.github.com/users/os-autoinst","html_url":"https://github.com/os-autoinst","followers_url":"https://api.github.com/users/os-autoinst/followers","following_url":"https://api.github.com/users/os-autoinst/following{/other_user}","gists_url":"https://api.github.com/users/os-autoinst/gists{/gist_id}","starred_url":"https://api.github.com/users/os-autoinst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/os-autoinst/subscriptions","organizations_url":"https://api.github.com/users/os-autoinst/orgs","repos_url":"https://api.github.com/users/os-autoinst/repos","events_url":"https://api.github.com/users/os-autoinst/events{/privacy}","received_events_url":"https://api.github.com/users/os-autoinst/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/os-autoinst/os-autoinst","description":"OS-level test automation","fork":false,"url":"https://api.github.com/repos/os-autoinst/os-autoinst","forks_url":"https://api.github.com/repos/os-autoinst/os-autoinst/forks","keys_url":"https://api.github.com/repos/os-autoinst/os-autoinst/keys{/key_id}","collaborators_url":"https://api.github.com/repos/os-autoinst/os-autoinst/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/os-autoinst/os-autoinst/teams","hooks_url":"https://api.github.com/repos/os-autoinst/os-autoinst/hooks","issue_events_url":"https://api.github.com/repos/os-autoinst/os-autoinst/issues/events{/number}","events_url":"https://api.github.com/repos/os-autoinst/os-autoinst/events","assignees_url":"https://api.github.com/repos/os-autoinst/os-autoinst/assignees{/user}","branches_url":"https://api.github.com/repos/os-autoinst/os-autoinst/branches{/branch}","tags_url":"https://api.github.com/repos/os-autoinst/os-autoinst/tags","blobs_url":"https://api.github.com/repos/os-autoinst/os-autoinst/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/os-autoinst/os-autoinst/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/os-autoinst/os-autoinst/git/refs{/sha}","trees_url":"https://api.github.com/repos/os-autoinst/os-autoinst/git/trees{/sha}","statuses_url":"https://api.github.com/repos/os-autoinst/os-autoinst/statuses/{sha}","languages_url":"https://api.github.com/repos/os-autoinst/os-autoinst/languages","stargazers_url":"https://api.github.com/repos/os-autoinst/os-autoinst/stargazers","contributors_url":"https://api.github.com/repos/os-autoinst/os-autoinst/contributors","subscribers_url":"https://api.github.com/repos/os-autoinst/os-autoinst/subscribers","subscription_url":"https://api.github.com/repos/os-autoinst/os-autoinst/subscription","commits_url":"https://api.github.com/repos/os-autoinst/os-autoinst/commits{/sha}","git_commits_url":"https://api.github.com/repos/os-autoinst/os-autoinst/git/commits{/sha}","comments_url":"https://api.github.com/repos/os-autoinst/os-autoinst/comments{/number}","issue_comment_url":"https://api.github.com/repos/os-autoinst/os-autoinst/issues/comments{/number}","contents_url":"https://api.github.com/repos/os-autoinst/os-autoinst/contents/{+path}","compare_url":"https://api.github.com/repos/os-autoinst/os-autoinst/compare/{base}...{head}","merges_url":"https://api.github.com/repos/os-autoinst/os-autoinst/merges","archive_url":"https://api.github.com/repos/os-autoinst/os-autoinst/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/os-autoinst/os-autoinst/downloads","issues_url":"https://api.github.com/repos/os-autoinst/os-autoinst/issues{/number}","pulls_url":"https://api.github.com/repos/os-autoinst/os-autoinst/pulls{/number}","milestones_url":"https://api.github.com/repos/os-autoinst/os-autoinst/milestones{/number}","notifications_url":"https://api.github.com/repos/os-autoinst/os-autoinst/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/os-autoinst/os-autoinst/labels{/name}","releases_url":"https://api.github.com/repos/os-autoinst/os-autoinst/releases{/id}","deployments_url":"https://api.github.com/repos/os-autoinst/os-autoinst/deployments","created_at":"2011-12-22T16:07:47Z","updated_at":"2016-10-26T05:29:37Z","pushed_at":"2016-10-27T16:14:34Z","git_url":"git://github.com/os-autoinst/os-autoinst.git","ssh_url":"git@github.com:os-autoinst/os-autoinst.git","clone_url":"https://github.com/os-autoinst/os-autoinst.git","svn_url":"https://github.com/os-autoinst/os-autoinst","homepage":"","size":15066,"stargazers_count":42,"watchers_count":42,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":64,"mirror_url":null,"open_issues_count":19,"forks":64,"open_issues":19,"watchers":42,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/os-autoinst/os-autoinst/pulls/637"},"html":{"href":"https://github.com/os-autoinst/os-autoinst/pull/637"},"issue":{"href":"https://api.github.com/repos/os-autoinst/os-autoinst/issues/637"},"comments":{"href":"https://api.github.com/repos/os-autoinst/os-autoinst/issues/637/comments"},"review_comments":{"href":"https://api.github.com/repos/os-autoinst/os-autoinst/pulls/637/comments"},"review_comment":{"href":"https://api.github.com/repos/os-autoinst/os-autoinst/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/os-autoinst/os-autoinst/pulls/637/commits"},"statuses":{"href":"https://api.github.com/repos/os-autoinst/os-autoinst/statuses/cd5c2a4fe4cb7ea9b5363a28fd4e4c8fb1f4c9ea"}}}}
{"actor":{"display_login":"aaannz"}}