diff -Nru checkbox-ng-1.12.0~ppa~ubuntu16.04.1/.bumpversion.cfg checkbox-ng-1.13.0~ppa~ubuntu16.04.1/.bumpversion.cfg --- checkbox-ng-1.12.0~ppa~ubuntu16.04.1/.bumpversion.cfg 2021-01-26 09:08:04.000000000 +0000 +++ checkbox-ng-1.13.0~ppa~ubuntu16.04.1/.bumpversion.cfg 2021-04-30 08:08:08.000000000 +0000 @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.12.0 +current_version = 1.13.0 parse = (?P\d+)\.(?P\d+)(\.(?P\d+))?((?P\.?[a-z]+)(?P\d+))? serialize = {major}.{minor}.{patch}{release}{N} diff -Nru checkbox-ng-1.12.0~ppa~ubuntu16.04.1/checkbox_ng/__init__.py checkbox-ng-1.13.0~ppa~ubuntu16.04.1/checkbox_ng/__init__.py --- checkbox-ng-1.12.0~ppa~ubuntu16.04.1/checkbox_ng/__init__.py 2021-01-26 09:08:04.000000000 +0000 +++ checkbox-ng-1.13.0~ppa~ubuntu16.04.1/checkbox_ng/__init__.py 2021-04-30 08:08:08.000000000 +0000 @@ -24,4 +24,4 @@ CheckBoxNG is a new version of CheckBox built on top of PlainBox """ -__version__ = '1.12.0' +__version__ = '1.13.0' diff -Nru checkbox-ng-1.12.0~ppa~ubuntu16.04.1/checkbox_ng/launcher/master.py checkbox-ng-1.13.0~ppa~ubuntu16.04.1/checkbox_ng/launcher/master.py --- checkbox-ng-1.12.0~ppa~ubuntu16.04.1/checkbox_ng/launcher/master.py 2021-01-26 09:08:04.000000000 +0000 +++ checkbox-ng-1.13.0~ppa~ubuntu16.04.1/checkbox_ng/launcher/master.py 2021-04-30 08:08:08.000000000 +0000 @@ -453,8 +453,10 @@ if not res[0]: break # XXX: this assumes that sys.stdin is chunked in lines - self.sa.transmit_input(res[0][0].readline()) - + buff = res[0][0].readline() + self.sa.transmit_input(buff) + if not buff: + break else: if dont_finish: return diff -Nru checkbox-ng-1.12.0~ppa~ubuntu16.04.1/debian/changelog checkbox-ng-1.13.0~ppa~ubuntu16.04.1/debian/changelog --- checkbox-ng-1.12.0~ppa~ubuntu16.04.1/debian/changelog 2021-01-26 09:09:05.000000000 +0000 +++ checkbox-ng-1.13.0~ppa~ubuntu16.04.1/debian/changelog 2021-04-30 08:12:16.000000000 +0000 @@ -1,10 +1,10 @@ -checkbox-ng (1.12.0~ppa~ubuntu16.04.1) xenial; urgency=low +checkbox-ng (1.13.0~ppa~ubuntu16.04.1) xenial; urgency=low * Auto build. - -- Canonical Certification Team Tue, 26 Jan 2021 09:09:05 +0000 + -- Canonical Certification Team Fri, 30 Apr 2021 08:12:16 +0000 -checkbox-ng (1.12.0-1) UNRELEASED; urgency=medium +checkbox-ng (1.13.0-1) UNRELEASED; urgency=medium [ Sylvain Pineau ] * Open for development (remove this message before releasing) @@ -40,8 +40,10 @@ * "new upstream version" * "new upstream version" * "new upstream version" + * "new upstream version" + * "new upstream version" - -- Jenkins Tue, 26 Jan 2021 08:32:56 +0000 + -- Jenkins Fri, 30 Apr 2021 07:11:06 +0000 checkbox-ng (1.0.0-1) UNRELEASED; urgency=medium diff -Nru checkbox-ng-1.12.0~ppa~ubuntu16.04.1/debian/git-build-recipe.manifest checkbox-ng-1.13.0~ppa~ubuntu16.04.1/debian/git-build-recipe.manifest --- checkbox-ng-1.12.0~ppa~ubuntu16.04.1/debian/git-build-recipe.manifest 2021-01-26 09:09:05.000000000 +0000 +++ checkbox-ng-1.13.0~ppa~ubuntu16.04.1/debian/git-build-recipe.manifest 2021-04-30 08:12:16.000000000 +0000 @@ -1,3 +1,3 @@ -# git-build-recipe format 0.4 deb-version 1.12.0~ppa -lp:checkbox-ng git-commit:16d66c27b5c927b1a128ffeebe657d979b0482cd -nest-part packaging lp:~checkbox-dev/checkbox-ng/+git/packaging debian debian git-commit:3465bf904ef6267c7f8ac56ab08e1302c09a2f13 +# git-build-recipe format 0.4 deb-version 1.13.0~ppa +lp:checkbox-ng git-commit:ff00545229534ffb9c55abbac7e18703a6af20a2 +nest-part packaging lp:~checkbox-dev/checkbox-ng/+git/packaging debian debian git-commit:3b477b299a6f716bff274586d30e62f82328abd3 diff -Nru checkbox-ng-1.12.0~ppa~ubuntu16.04.1/debian/.git-dpm checkbox-ng-1.13.0~ppa~ubuntu16.04.1/debian/.git-dpm --- checkbox-ng-1.12.0~ppa~ubuntu16.04.1/debian/.git-dpm 2021-01-26 09:09:05.000000000 +0000 +++ checkbox-ng-1.13.0~ppa~ubuntu16.04.1/debian/.git-dpm 2021-04-30 08:12:16.000000000 +0000 @@ -1,8 +1,8 @@ # see git-dpm(1) from git-dpm package -5eacb8cbc6b447df1fd9df833c63263809937a7d -5eacb8cbc6b447df1fd9df833c63263809937a7d -243fe6230e7a44f2a3a5018a65aa3bc06a97ed13 -243fe6230e7a44f2a3a5018a65aa3bc06a97ed13 -checkbox-ng_1.12.0.orig.tar.gz -5bc2829bf5216bb20f054313d555db01da51d176 -2155669 +98cc1971fdf9275565ba5cd882022190c1854195 +98cc1971fdf9275565ba5cd882022190c1854195 +3aae3dc506be7bb52fdfacd34eb7a6a7cfedd368 +3aae3dc506be7bb52fdfacd34eb7a6a7cfedd368 +checkbox-ng_1.13.0.orig.tar.gz +3a29a1486c98521bb0c8c7be73121f027d58a101 +2159458 diff -Nru checkbox-ng-1.12.0~ppa~ubuntu16.04.1/docs/conf.py checkbox-ng-1.13.0~ppa~ubuntu16.04.1/docs/conf.py --- checkbox-ng-1.12.0~ppa~ubuntu16.04.1/docs/conf.py 2021-01-26 09:09:05.000000000 +0000 +++ checkbox-ng-1.13.0~ppa~ubuntu16.04.1/docs/conf.py 2021-04-30 08:12:16.000000000 +0000 @@ -77,7 +77,7 @@ # General information about the project. project = 'Checkbox' -copyright = '2013-2019, Checkbox Developers' +copyright = '2013-2021, Checkbox Developers' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff -Nru checkbox-ng-1.12.0~ppa~ubuntu16.04.1/docs/contributing.rst checkbox-ng-1.13.0~ppa~ubuntu16.04.1/docs/contributing.rst --- checkbox-ng-1.12.0~ppa~ubuntu16.04.1/docs/contributing.rst 1970-01-01 00:00:00.000000000 +0000 +++ checkbox-ng-1.13.0~ppa~ubuntu16.04.1/docs/contributing.rst 2021-04-30 08:08:08.000000000 +0000 @@ -0,0 +1,233 @@ +Contributing to Checkbox +======================== + +.. contents:: + + +Introduction +------------ + +This document provides the information needed to contribute to Checkbox and its providers. + + +General recommendations +----------------------- + +Setup your editor of choice to run autopep8_ on save. This helps keep everything passing flake8_. +The code doesn’t have to be pylint-clean, but running pylint_ on your code may inform you about issues that could come up later in the review process. + + +Testing +------- + + +Hacking on Checkbox and/or its providers +```````````````````````````````````````` + +If you want to hack on Checkbox or its providers, one method is to install everything you need in a Python virtual environment: + +.. code-block:: bash + + # Install the required tools + $ sudo apt install git python3-virtualenv + + # Prepare the development environment + $ mkdir ~/checkbox-dev/ + $ cd ~/checkbox-dev/ + $ git clone git+ssh://pieq@git.launchpad.net/checkbox-ng + $ git clone git+ssh://pieq@git.launchpad.net/checkbox-support + $ git clone git+ssh://pieq@git.launchpad.net/plainbox-provider-resource + $ git clone git+ssh://pieq@git.launchpad.net/plainbox-provider-checkbox + + # Create and activate the Python virtual environment + $ cd ~/checkbox-dev/checkbox-ng + $ ./mk-venv + $ . ~/checkbox-dev/checkbox-ng/venv/bin/activate + + # Activate the base providers in the virtual environment + (venv) $ cd ~/checkbox-dev/plainbox-provider-resource/ + (venv) $ ./manage.py develop -d $PROVIDERPATH + (venv) $ cd ~/checkbox-dev/plainbox-provider-checkbox + (venv) $ ./manage.py develop -d $PROVIDERPATH + + # Install the Checkbox support library in the virtual environment + (venv) $ cd ~/checkbox-dev/checkbox-support + (venv) $ ./setup.py install + + # You should now be able to run checkbox, select a test plan and run it + (venv) $ checkbox-cli + + +Writing and running unit tests for Checkbox +``````````````````````````````````````````` + +Writing unit tests for your code is strongly recommended. For functions with an easily defined input and output, use doctest_. For more complex units of code use the standard `unittest library`_. + + +Writing and running unit tests for providers +```````````````````````````````````````````` + +Ensure the job and test plan definitions follow the correct syntax using the validate command:: + + $ ./manage.py validate + + +Run checks for code quality of provider hosted scripts and any unit tests for providers:: + + $ ./manage.py test + + +Version control recommendations +------------------------------- + + +Commit title +```````````` + +In general, try to follow `Chris Beams’ recommendations`_. In a nutshell: + + - Limit the length of the title to 50 characters + - Begin title with a capital letter + - Use the imperative mode (your title should always be able to complete the sentence “If applied, this commit will...”) + + +In addition, if it makes sense to do so, prefix the title with one of the following terms: + + - Add + - Change + - Remove + - Fix + +Example:: + + Add: New screen to re-run failed jobs + + +Commit message body +``````````````````` + +Quoting again from Chris Beams’ article, use the body to explain what and why vs. how. + + +Example:: + + Change: Shellcheck on bin dir scripts + + The test command to manage.py currently looks for python unittests + in the provider tests/ directory. This change searches the bin/ + directory for files with suffix .sh and automatically generates + a unittest that runs the shellcheck command on the file. + + +Linking a commit to a Launchpad bug +``````````````````````````````````` + +If your commit fixes a Launchpad bug, you can link to it by adding the following line in the commit message body (where “123456” is the Launchpad bug number):: + + LP: #123456 + +See `this article on the Launchpad blog`_ for more information. + + +Splitting work in separate commits if required +`````````````````````````````````````````````` + +If the changes you provide affect different parts of the project, it is better to split them in different commits. This helps others when reviewing the changes, helps investigation later on if a problem is found and usually helps the original developer to better explain and organize his/her changes. + + +For example, if you add a new screen to the Checkbox text user interface (TUI) and then modify Checkbox internals to work with this new screen, it is good to have one commit for the new screen, and one for the internals changes. + + +Each commit should be stable, i.e. not introduce regressions or make tests fail. If two or more commits have to be used together, then they should become one commit. + + +Rework your changes +``````````````````` + +Sometimes it is necessary to modify your changes (for instance after they have been reviewed by others). Instead of creating new commits with these new modifications, it is preferred to use Git features such as rebase_ to rework your existing commits. + + +Merge requests +-------------- + + +General workflow +```````````````` + +Follow these steps to make a change to a Checkbox-related project. We will use the `Checkbox provider`_ for this example, but the same applies for other projects. + + +1. Using the instructions provided in the Code section, get the Git repository on your device:: + + git clone git+ssh://your-launchpad-id@git.launchpad.net/plainbox-provider-checkbox + +2. Add a remote pointing to your own Launchpad account. This will be helpful when pushing the changes and asking for it to be reviewed and merged. Here, I create a remote called “perso” that points to my fork of the repository on Launchpad (replace “pieq” with your own Launchpad username):: + + $ git remote add perso git+ssh://pieq@git.launchpad.net/~pieq/plainbox-provider-checkbox + $ git remote -v + origin git+ssh://pieq@git.launchpad.net/plainbox-provider-checkbox (fetch) + origin git+ssh://pieq@git.launchpad.net/plainbox-provider-checkbox (push) + perso git+ssh://pieq@git.launchpad.net/~pieq/plainbox-provider-checkbox (fetch) + perso git+ssh://pieq@git.launchpad.net/~pieq/plainbox-provider-checkbox (push) + +3. Create a branch and switch to it to start working on your changes. You can use any branch name, but it is generally good to include the Launchpad bug number it relates to as well as a quick explanation of what the branch is about:: + + $ git checkout -b 123456-invalid-session-content + +4. Work on your changes, test them, iterate, commit your work. + +5. Before sending your changes for review, make sure to rebase your work using the most up-to-date data from the main repository:: + + $ git checkout master + $ git pull + $ git checkout 123456-invalid-session-content + $ git rebase master + First, rewinding head to replay your work on top of it... + Applying: + +6. Push your changes to your Launchpad repository:: + + $ git push perso + Enumerating objects: 741, done. + Counting objects: 100% (612/612), done. + Delta compression using up to 4 threads + Compressing objects: 100% (242/242), done. + Writing objects: 100% (522/522), 80.41 KiB | 26.80 MiB/s, done. + Total 522 (delta 336), reused 460 (delta 280) + remote: Resolving deltas: 100% (336/336), completed with 54 local objects. + remote: + remote: Create a merge proposal for '123456-invalid-session-content' on Launchpad by visiting: + remote: https://code.launchpad.net/~pieq/plainbox-provider-checkbox/+git/plainbox-provider-checkbox/+ref/123456-invalid-session-content/+register-merge + remote: + To git+ssh://git.launchpad.net/~pieq/plainbox-provider-checkbox + * [new branch] 123456-invalid-session-content -> 123456-invalid-session-content + +7. Follow the link provided by Launchpad in the previous step to create a merge request. The most important options of the “Propose for merging” page are: + a. ``Repository`` and ``Branch``: Where your changes should land once they are approved. It should be already filled with the appropriate information. + b. ``Description of the change``: Explain why this change is required, how it was tested (and on what hardware) and how other people can test it. + c. Other fields do not have to be changed. Press the ``Propose Merge`` button and wait for feedback ;-) + + +What to do if reviewers suggest changes in your merge request? +`````````````````````````````````````````````````````````````` + +1. Change the top status of the MR to “Work in progress”. This both stops people wasting time reviewing some code which will be changed and also allows Launchpad to indicate to people who have already reviewed that the code should be reviewed again. +2. Instead of adding extra commits to fix your previous commits, use `git rebase features`_ to modify your existing commits. You can push your changes again to your personal repository; you will probably need to use the ``git push --force my_repo`` command since you “modified history”, but this is fine since you are pushing changes that have not been merged into the main repository yet. +3. When you have pushed the new version addressing the previous round of reviews, switch the top status back to “Needs review”. Launchpad will send out an e-mail indicating that reviews are needed again. Do not post a comment with type “Resubmit”; this is not the purpose of that sort of comment. + + +Finally... +`````````` + +Once enough people have reviewed and approved your work, it can be merged into the main repository. Ask a member of the Checkbox team to switch the merge request status from “Needs review” to “Approved”. The branch should be then shortly automatically merged. Its status will then change from “Approved” to “Merged”. + +.. _autopep8: https://pypi.org/project/autopep8/ +.. _flake8: https://flake8.pycqa.org/en/latest/ +.. _pylint: https://www.pylint.org/ +.. _doctest: https://docs.python.org/3/library/doctest.html +.. _unittest library: https://docs.python.org/3/library/unittest.html +.. _Chris Beams’ recommendations: https://chris.beams.io/posts/git-commit/ +.. _this article on the Launchpad blog: https://blog.launchpad.net/code/linking-git-merge-proposals-to-bugs +.. _rebase: https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History +.. _Checkbox provider: https://launchpad.net/plainbox-provider-checkbox +.. _git rebase features: rebase_ diff -Nru checkbox-ng-1.12.0~ppa~ubuntu16.04.1/docs/index.rst checkbox-ng-1.13.0~ppa~ubuntu16.04.1/docs/index.rst --- checkbox-ng-1.12.0~ppa~ubuntu16.04.1/docs/index.rst 2021-01-26 09:08:04.000000000 +0000 +++ checkbox-ng-1.13.0~ppa~ubuntu16.04.1/docs/index.rst 2021-04-30 08:08:08.000000000 +0000 @@ -72,6 +72,7 @@ snappy.rst testing-snappy.rst custom-app.rst + contributing.rst glossary.rst Indices and tables diff -Nru checkbox-ng-1.12.0~ppa~ubuntu16.04.1/mk-venv checkbox-ng-1.13.0~ppa~ubuntu16.04.1/mk-venv --- checkbox-ng-1.12.0~ppa~ubuntu16.04.1/mk-venv 2021-01-26 09:08:04.000000000 +0000 +++ checkbox-ng-1.13.0~ppa~ubuntu16.04.1/mk-venv 2021-04-30 08:08:08.000000000 +0000 @@ -13,6 +13,7 @@ . $venv_path/bin/activate python3 setup.py develop --quiet | sed -e 's/^/I (develop output) /' +pip install tqdm psutil mkdir -p "$venv_path/share/plainbox-providers-1" echo "export PROVIDERPATH=$venv_path/share/plainbox-providers-1" >> $venv_path/bin/activate diff -Nru checkbox-ng-1.12.0~ppa~ubuntu16.04.1/.pc/documentation-theme/docs/conf.py checkbox-ng-1.13.0~ppa~ubuntu16.04.1/.pc/documentation-theme/docs/conf.py --- checkbox-ng-1.12.0~ppa~ubuntu16.04.1/.pc/documentation-theme/docs/conf.py 2021-01-26 09:09:05.000000000 +0000 +++ checkbox-ng-1.13.0~ppa~ubuntu16.04.1/.pc/documentation-theme/docs/conf.py 2021-04-30 08:12:16.000000000 +0000 @@ -77,7 +77,7 @@ # General information about the project. project = 'Checkbox' -copyright = '2013-2019, Checkbox Developers' +copyright = '2013-2021, Checkbox Developers' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff -Nru checkbox-ng-1.12.0~ppa~ubuntu16.04.1/.pc/.quilt_patches checkbox-ng-1.13.0~ppa~ubuntu16.04.1/.pc/.quilt_patches --- checkbox-ng-1.12.0~ppa~ubuntu16.04.1/.pc/.quilt_patches 2021-01-26 09:09:05.000000000 +0000 +++ checkbox-ng-1.13.0~ppa~ubuntu16.04.1/.pc/.quilt_patches 2021-04-30 08:12:16.000000000 +0000 @@ -1 +1 @@ -/home/buildd/build-RECIPEBRANCHBUILD-2724735/chroot-autobuild/home/buildd/work/tree/recipe/debian/patches +/home/buildd/build-RECIPEBRANCHBUILD-2786307/chroot-autobuild/home/buildd/work/tree/recipe/debian/patches diff -Nru checkbox-ng-1.12.0~ppa~ubuntu16.04.1/.pc/.quilt_series checkbox-ng-1.13.0~ppa~ubuntu16.04.1/.pc/.quilt_series --- checkbox-ng-1.12.0~ppa~ubuntu16.04.1/.pc/.quilt_series 2021-01-26 09:09:05.000000000 +0000 +++ checkbox-ng-1.13.0~ppa~ubuntu16.04.1/.pc/.quilt_series 2021-04-30 08:12:16.000000000 +0000 @@ -1 +1 @@ -/home/buildd/build-RECIPEBRANCHBUILD-2724735/chroot-autobuild/home/buildd/work/tree/recipe/debian/patches/series +/home/buildd/build-RECIPEBRANCHBUILD-2786307/chroot-autobuild/home/buildd/work/tree/recipe/debian/patches/series diff -Nru checkbox-ng-1.12.0~ppa~ubuntu16.04.1/plainbox/impl/execution.py checkbox-ng-1.13.0~ppa~ubuntu16.04.1/plainbox/impl/execution.py --- checkbox-ng-1.12.0~ppa~ubuntu16.04.1/plainbox/impl/execution.py 2021-01-26 09:08:04.000000000 +0000 +++ checkbox-ng-1.13.0~ppa~ubuntu16.04.1/plainbox/impl/execution.py 2021-04-30 08:08:08.000000000 +0000 @@ -533,7 +533,7 @@ delta_env['LANGUAGE'] = '' delta_env['LC_ALL'] = 'C.UTF-8' if extra_env: - delta_env.update(extra_env) + delta_env.update(extra_env()) # Preserve the copy_vars variables + those prefixed with SNAP on Snappy if (os.getenv("SNAP") or os.getenv("SNAP_APP_PATH")): copy_vars = ['PYTHONHOME', 'PYTHONUSERBASE', 'LD_LIBRARY_PATH', @@ -564,7 +564,7 @@ else: env = get_execution_environment(job, environ, session_id, nest_dir) if extra_env: - env.update(extra_env) + env.update(extra_env()) cmd += ["{key}={value}".format(key=key, value=value) for key, value in sorted(env.items())] cmd += [job.shell, '-c', job.command] diff -Nru checkbox-ng-1.12.0~ppa~ubuntu16.04.1/plainbox/impl/providers/exporters/data/checkbox.json checkbox-ng-1.13.0~ppa~ubuntu16.04.1/plainbox/impl/providers/exporters/data/checkbox.json --- checkbox-ng-1.12.0~ppa~ubuntu16.04.1/plainbox/impl/providers/exporters/data/checkbox.json 2021-01-26 09:08:04.000000000 +0000 +++ checkbox-ng-1.13.0~ppa~ubuntu16.04.1/plainbox/impl/providers/exporters/data/checkbox.json 2021-04-30 08:08:08.000000000 +0000 @@ -175,10 +175,6 @@ {%- endif %} {%- if ns ~ 'info/buildstamp' in state.job_state_map and state.job_state_map[ns ~ 'info/buildstamp'].result.outcome == 'pass' %}, {%- set buildstamp = state.job_state_map[ns ~ 'info/buildstamp'].result.io_log_as_text_attachment.rstrip().splitlines() %} -{%- if buildstamp|length >= 2 %} - "buildstamp": {{ buildstamp[1] | jsonify | safe }} -{%- else %} - "buildstamp": "" -{%- endif %} + "buildstamp": {{ buildstamp[-1] | jsonify | safe }} {%- endif %} } diff -Nru checkbox-ng-1.12.0~ppa~ubuntu16.04.1/plainbox/impl/session/remote_assistant.py checkbox-ng-1.13.0~ppa~ubuntu16.04.1/plainbox/impl/session/remote_assistant.py --- checkbox-ng-1.12.0~ppa~ubuntu16.04.1/plainbox/impl/session/remote_assistant.py 2021-01-26 09:08:04.000000000 +0000 +++ checkbox-ng-1.13.0~ppa~ubuntu16.04.1/plainbox/impl/session/remote_assistant.py 2021-04-30 08:08:08.000000000 +0000 @@ -24,6 +24,7 @@ import pwd import time from collections import namedtuple +from contextlib import suppress from tempfile import SpooledTemporaryFile from threading import Thread, Lock from subprocess import CalledProcessError, check_output @@ -229,7 +230,7 @@ 'unix:path=/run/user/{}/bus'.format(uid) } except CalledProcessError: - return None + return {} def prepare_extra_env(self): # If possible also set the DISPLAY env var @@ -260,6 +261,7 @@ 'DBUS_SESSION_BUS_ADDRESS': 'unix:path=/run/user/{}/bus'.format(uid) } + return {} @allowed_when(Idle) def start_session(self, configuration): @@ -284,19 +286,11 @@ else: self._normal_user = self._launcher.normal_user if not self._normal_user: - try: - self._normal_user = pwd.getpwuid(1000).pw_name - _logger.warning( - ("normal_user not supplied via config(s). " - "non-root jobs will run as %s"), self._normal_user) - except KeyError: - raise RuntimeError( - ("normal_user not supplied via config(s). " - "Username for uid 1000 not found")) + self._normal_user = _guess_normal_user() runner_kwargs = { 'normal_user_provider': lambda: self._normal_user, 'stdin': self._pipe_to_subproc, - 'extra_env': self.prepare_extra_env(), + 'extra_env': self.prepare_extra_env, } self._sa.start_new_session(session_title, UnifiedRunner, runner_kwargs) new_blob = json.dumps({ @@ -645,7 +639,7 @@ runner_kwargs = { 'normal_user_provider': lambda: self._normal_user, 'stdin': self._pipe_to_subproc, - 'extra_env': self.prepare_extra_env(), + 'extra_env': self.prepare_extra_env, } meta = self._sa.resume_session(session_id, runner_kwargs=runner_kwargs) app_blob = json.loads(meta.app_blob.decode("UTF-8")) @@ -704,6 +698,9 @@ self._reset_sa() def transmit_input(self, text): + if not text: + self._pipe_from_master.close() + return self._pipe_from_master.write(text) self._pipe_from_master.flush() @@ -733,3 +730,17 @@ exporter.dump_from_session_manager(self._sa._manager, exported_stream) exported_stream.flush() return exported_stream + +def _guess_normal_user(): + _logger.warning("normal_user not supplied via config(s).") + for entry in pwd.getpwall(): + if entry.pw_name == 'ubuntu': + _logger.warning("Using `ubuntu` user") + return 'ubuntu' + with suppress(KeyError): + user = pwd.getpwuid(1000).pw_name + _logger.warning("Using `%s` user", user) + return user + raise RuntimeError( + ("normal_user not supplied via config(s). " + "User `ubuntu` and username for uid 1000 were not found")) diff -Nru checkbox-ng-1.12.0~ppa~ubuntu16.04.1/plainbox/__init__.py checkbox-ng-1.13.0~ppa~ubuntu16.04.1/plainbox/__init__.py --- checkbox-ng-1.12.0~ppa~ubuntu16.04.1/plainbox/__init__.py 2021-01-26 09:08:04.000000000 +0000 +++ checkbox-ng-1.13.0~ppa~ubuntu16.04.1/plainbox/__init__.py 2021-04-30 08:08:08.000000000 +0000 @@ -27,7 +27,7 @@ # PEP440 compliant version declaration. # # This is used by @public decorator to enforce our public API guarantees. -__version__ = '1.12.0' +__version__ = '1.13.0' def get_version_string(): import os diff -Nru checkbox-ng-1.12.0~ppa~ubuntu16.04.1/.pmr-merge-hook checkbox-ng-1.13.0~ppa~ubuntu16.04.1/.pmr-merge-hook --- checkbox-ng-1.12.0~ppa~ubuntu16.04.1/.pmr-merge-hook 2021-01-26 09:08:04.000000000 +0000 +++ checkbox-ng-1.13.0~ppa~ubuntu16.04.1/.pmr-merge-hook 2021-04-30 08:08:08.000000000 +0000 @@ -8,4 +8,4 @@ cat timing.dat # Ping rtfd.org to refresh the documentation -curl -X POST -d "branches=latest" -d "token=171e3fc78c690eb55c0ea4dccb703f65bf5be5f57" https://readthedocs.org/api/v2/webhook/checkbox/137367/ +curl -X POST -d "branches=latest" -d "token=71e3fc78c690eb55c0ea4dccb703f65bf5be5f57" https://readthedocs.org/api/v2/webhook/checkbox/137367/ diff -Nru checkbox-ng-1.12.0~ppa~ubuntu16.04.1/setup.py checkbox-ng-1.13.0~ppa~ubuntu16.04.1/setup.py --- checkbox-ng-1.12.0~ppa~ubuntu16.04.1/setup.py 2021-01-26 09:08:04.000000000 +0000 +++ checkbox-ng-1.13.0~ppa~ubuntu16.04.1/setup.py 2021-04-30 08:08:08.000000000 +0000 @@ -48,12 +48,12 @@ 'requests >= 1.0', 'urwid >= 1.1.1', 'Jinja2 >= 2.7', - 'xlsxwriter >= 0.3', + 'xlsxwriter', ] setup( name="checkbox-ng", - version="1.12.0", + version="1.13.0", url="https://launchpad.net/checkbox-ng/", packages=find_packages(), author="Zygmunt Krynicki",