Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package osc for openSUSE:Factory checked in at 2023-08-28 17:17:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/osc (Old) and /work/SRC/openSUSE:Factory/.osc.new.1766 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "osc" Mon Aug 28 17:17:44 2023 rev:181 rq:1106883 version:1.3.1 Changes: -------- --- /work/SRC/openSUSE:Factory/osc/osc.changes 2023-08-10 15:34:37.404434297 +0200 +++ /work/SRC/openSUSE:Factory/.osc.new.1766/osc.changes 2023-08-28 17:17:46.690172887 +0200 @@ -1,0 +2,16 @@ +Mon Aug 28 11:38:33 UTC 2023 - Daniel Mach <daniel.m...@suse.com> + +- 1.3.1 + - Command-line: + - Fix string + int concatenation errors in 'build' command by using f-strings instead + - Fix '--all' option in 'rebuild' command + - Fix 'build' command when '--alternative-project' option is specified and the git branch cannot be mapped to a project + - Stop suggesting that the working directory is git/mercurial/svn/cvs + - Be helpful in deprecating commands + - Configuration: + - Add more config options among integer options + - Library: + - Fix GitStore to error out properly if there is no 'origin' remote in the git repo + - print_buildlog: Remove control characters from build log before printing (CVE-2012-1095) + +------------------------------------------------------------------- Old: ---- osc-1.3.0.tar.gz New: ---- osc-1.3.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ osc.spec ++++++ --- /var/tmp/diff_new_pack.NBSO8g/_old 2023-08-28 17:17:48.682244422 +0200 +++ /var/tmp/diff_new_pack.NBSO8g/_new 2023-08-28 17:17:48.686244565 +0200 @@ -49,7 +49,7 @@ %endif Name: osc -Version: 1.3.0 +Version: 1.3.1 Release: 0 Summary: Command-line client for the Open Build Service License: GPL-2.0-or-later ++++++ PKGBUILD ++++++ --- /var/tmp/diff_new_pack.NBSO8g/_old 2023-08-28 17:17:48.718245715 +0200 +++ /var/tmp/diff_new_pack.NBSO8g/_new 2023-08-28 17:17:48.722245858 +0200 @@ -1,5 +1,5 @@ pkgname=osc -pkgver=1.3.0 +pkgver=1.3.1 pkgrel=0 pkgdesc="Command-line client for the Open Build Service" arch=('x86_64') ++++++ debian.changelog ++++++ --- /var/tmp/diff_new_pack.NBSO8g/_old 2023-08-28 17:17:48.762247295 +0200 +++ /var/tmp/diff_new_pack.NBSO8g/_new 2023-08-28 17:17:48.762247295 +0200 @@ -1,4 +1,4 @@ -osc (1.3.0-0) unstable; urgency=low +osc (1.3.1-0) unstable; urgency=low * Placeholder ++++++ osc-1.3.0.tar.gz -> osc-1.3.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-1.3.0/NEWS new/osc-1.3.1/NEWS --- old/osc-1.3.0/NEWS 2023-08-09 13:34:16.000000000 +0200 +++ new/osc-1.3.1/NEWS 2023-08-28 13:33:45.000000000 +0200 @@ -1,3 +1,16 @@ +- 1.3.1 + - Command-line: + - Fix string + int concatenation errors in 'build' command by using f-strings instead + - Fix '--all' option in 'rebuild' command + - Fix 'build' command when '--alternative-project' option is specified and the git branch cannot be mapped to a project + - Stop suggesting that the working directory is git/mercurial/svn/cvs + - Be helpful in deprecating commands + - Configuration: + - Add more config options among integer options + - Library: + - Fix GitStore to error out properly if there is no 'origin' remote in the git repo + - print_buildlog: Remove control characters from build log before printing (CVE-2012-1095) + - 1.3.0 - Command-line: - Add experimental support of Git SCM to the 'build' command diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-1.3.0/osc/__init__.py new/osc-1.3.1/osc/__init__.py --- old/osc-1.3.0/osc/__init__.py 2023-08-09 13:34:16.000000000 +0200 +++ new/osc-1.3.1/osc/__init__.py 2023-08-28 13:33:45.000000000 +0200 @@ -13,7 +13,7 @@ from .util import git_version -__version__ = git_version.get_version('1.3.0') +__version__ = git_version.get_version('1.3.1') # vim: sw=4 et diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-1.3.0/osc/babysitter.py new/osc-1.3.1/osc/babysitter.py --- old/osc-1.3.0/osc/babysitter.py 2023-08-09 13:34:16.000000000 +0200 +++ new/osc-1.3.1/osc/babysitter.py 2023-08-28 13:33:45.000000000 +0200 @@ -98,14 +98,6 @@ print(e, file=sys.stderr) except oscerr.NoWorkingCopy as e: print(e, file=sys.stderr) - if os.path.isdir('.git'): - print("Current directory looks like git.", file=sys.stderr) - if os.path.isdir('.hg'): - print("Current directory looks like mercurial.", file=sys.stderr) - if os.path.isdir('.svn'): - print("Current directory looks like svn.", file=sys.stderr) - if os.path.isdir('CVS'): - print("Current directory looks like cvs.", file=sys.stderr) except HTTPError as e: print('Server returned an error:', e, file=sys.stderr) if hasattr(e, 'osc_msg'): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-1.3.0/osc/build.py new/osc-1.3.1/osc/build.py --- old/osc-1.3.0/osc/build.py 2023-08-09 13:34:16.000000000 +0200 +++ new/osc-1.3.1/osc/build.py 2023-08-28 13:33:45.000000000 +0200 @@ -1451,41 +1451,44 @@ else: my_build_swap = build_root + '/swap' - vm_options = ['--vm-type=%s' % vm_type] + vm_options = [f"--vm-type={vm_type}"] if vm_telnet: - vm_options += ['--vm-telnet=' + vm_telnet] + vm_options += [f"--vm-telnet={vm_telnet}"] if vm_memory: - vm_options += ['--memory=' + vm_memory] + vm_options += [f"--memory={vm_memory}"] if vm_type != 'lxc' and vm_type != 'nspawn': - vm_options += ['--vm-disk=' + my_build_device] - vm_options += ['--vm-swap=' + my_build_swap] - vm_options += ['--logfile=%s/.build.log' % build_root] + vm_options += [f"--vm-disk={my_build_device}"] + vm_options += [f"--vm-swap={my_build_swap}"] + vm_options += [f"--logfile={build_root}/.build.log"] if vm_type == 'kvm': if config['build-kernel']: - vm_options += ['--vm-kernel=' + config['build-kernel']] + vm_options += [f"--vm-kernel={config['build-kernel']}"] if config['build-initrd']: - vm_options += ['--vm-initrd=' + config['build-initrd']] + vm_options += [f"--vm-initrd={config['build-initrd']}"] build_root += '/.mount' if vm_disk_size: - vm_options += ['--vmdisk-rootsize=' + vm_disk_size] + vm_options += [f"--vmdisk-rootsize={vm_disk_size}"] if config['build-vmdisk-swapsize']: - vm_options += ['--vmdisk-swapsize=' + config['build-vmdisk-swapsize']] + vm_options += [f"--vmdisk-swapsize={config['build-vmdisk-swapsize']}"] if config['build-vmdisk-filesystem']: - vm_options += ['--vmdisk-filesystem=' + config['build-vmdisk-filesystem']] + vm_options += [f"--vmdisk-filesystem={config['build-vmdisk-filesystem']}"] if config['build-vm-user']: - vm_options += ['--vm-user=' + config['build-vm-user']] + vm_options += [f"--vm-user={config['build-vm-user']}"] if opts.preload: print("Preload done for selected repo/arch.") sys.exit(0) print('Running build') - cmd = [config['build-cmd'], '--root=' + build_root, - '--rpmlist=' + rpmlist_filename, - '--dist=' + bc_filename, - '--arch=' + bi.buildarch] + cmd = [ + config['build-cmd'], + f"--root={build_root}", + f"--rpmlist={rpmlist_filename}", + f"--dist={bc_filename}", + f"--arch={bi.buildarch}", + ] cmd += specialcmdopts + vm_options + buildargs cmd += [build_descr] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-1.3.0/osc/commandline.py new/osc-1.3.1/osc/commandline.py --- old/osc-1.3.0/osc/commandline.py 2023-08-09 13:34:16.000000000 +0200 +++ new/osc-1.3.1/osc/commandline.py 2023-08-28 13:33:45.000000000 +0200 @@ -7232,8 +7232,12 @@ store = osc_store.get_store(Path.cwd(), print_warnings=True) store.assert_is_package() - if opts.alternative_project == store.project: - opts.alternative_project = None + try: + if opts.alternative_project and opts.alternative_project == store.project: + opts.alternative_project = None + except RuntimeError: + # ignore the following exception: Couldn't map git branch '<BRANCH>' to a project + pass # HACK: avoid calling some underlying store_*() functions from parse_repoarchdescr() method # We'll fix parse_repoarchdescr() later because it requires a larger change @@ -7599,8 +7603,6 @@ osc service run [SOURCE_SERVICE] osc service runall osc service manualrun [SOURCE_SERVICE] - osc service localrun [SOURCE_SERVICE] - osc service disabledrun [SOURCE_SERVICE] osc service remoterun [PROJECT PACKAGE] osc service merge [PROJECT PACKAGE] osc service wait [PROJECT PACKAGE] @@ -7629,7 +7631,6 @@ singleservice = None mode = None remote_commands = ("remoterun", "rr", "merge", "wait") - obsolete_commands = ("localrun", "lr", "disabledrun", "dr") if len(args) < 1: self.argparse_error("Please specify a command") @@ -7638,8 +7639,12 @@ if command not in ("runall", "ra", "run", "localrun", "manualrun", "disabledrun", "remoterun", "lr", "dr", "mr", "rr", "merge", "wait"): self.argparse_error(f"Invalid command: {command}") - if command in obsolete_commands: - print(f"WARNING: Command '{command}' is obsolete", file=sys.stderr) + if command in ("localrun", "lr"): + print(f"WARNING: Command '{command}' is obsolete, please use 'run' instead.", file=sys.stderr) + + if command in ("disabledrun", "dr"): + print(f"WARNING: Command '{command}' is obsolete,\n" + "please convert your _service to use 'manual' and then 'manualrun/mr' instead.", file=sys.stderr) if len(args) == 1: singleservice = args.pop(0) @@ -7730,7 +7735,10 @@ if not (opts.all or package or repo or arch or code): raise oscerr.WrongOptions('No option has been provided. If you want to rebuild all packages of the entire project, use --all option.') - if opts.multibuild_package: + if opts.all: + # ignore the package name which can come from a working copy + packages = [None] + elif opts.multibuild_package: resolver = MultibuildFlavorResolver(apiurl, project, package, use_local=False) packages = resolver.resolve_as_packages(opts.multibuild_package) else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-1.3.0/osc/conf.py new/osc-1.3.1/osc/conf.py --- old/osc-1.3.0/osc/conf.py 2023-08-09 13:34:16.000000000 +0200 +++ new/osc-1.3.1/osc/conf.py 2023-08-28 13:33:45.000000000 +0200 @@ -97,12 +97,12 @@ 'build-root': '/var/tmp/build-root/%(repo)s-%(arch)s', 'build-uid': '', # use the default provided by build 'build-device': '', # required for VM builds - 'build-memory': '', # required for VM builds + 'build-memory': '0', # required for VM builds 'build-shell-after-fail': '0', # optional for VM builds 'build-swap': '', # optional for VM builds - 'build-vmdisk-rootsize': '', # optional for VM builds - 'build-vmdisk-swapsize': '', # optional for VM builds - 'build-vmdisk-filesystem': '', # optional for VM builds + 'build-vmdisk-rootsize': '0', # optional for VM builds + 'build-vmdisk-swapsize': '0', # optional for VM builds + 'build-vmdisk-filesystem': '', # optional for VM builds 'build-vm-user': '', # optional for VM builds 'build-kernel': '', # optional for VM builds 'build-initrd': '', # optional for VM builds @@ -213,7 +213,8 @@ # _integer_opts and _boolean_opts specify option types for both global options as well as api_host_options -_integer_opts = ('build-jobs',) +_integer_opts = ("build-jobs", "build-memory", "build-vmdisk-rootsize", "build-vmdisk-swapsize", "http_retries", "icecream", "request_list_days") + _boolean_opts = ( 'debug', 'do_package_tracking', 'http_debug', 'post_mortem', 'traceback', 'check_filelist', 'checkout_no_colon', 'checkout_rooted', 'check_for_request_on_action', 'linkcontrol', 'show_download_progress', 'request_show_interactive', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-1.3.0/osc/core.py new/osc-1.3.1/osc/core.py --- old/osc-1.3.0/osc/core.py 2023-08-09 13:34:16.000000000 +0200 +++ new/osc-1.3.1/osc/core.py 2023-08-28 13:33:45.000000000 +0200 @@ -6955,8 +6955,11 @@ def print_data(data, strip_time=False): if strip_time: data = buildlog_strip_time(data) - output_buffer.write(data) + output_buffer.write(data.translate(all_bytes, remove_bytes)) + # to protect us against control characters (CVE-2012-1095) + all_bytes = bytes.maketrans(b'', b'') + remove_bytes = all_bytes[:8] + all_bytes[14:32] # accept tabs and newlines query = {'nostream': '1', 'start': '%s' % offset} if last: query['last'] = 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-1.3.0/osc/git_scm/store.py new/osc-1.3.1/osc/git_scm/store.py --- old/osc-1.3.0/osc/git_scm/store.py 2023-08-09 13:34:16.000000000 +0200 +++ new/osc-1.3.1/osc/git_scm/store.py 2023-08-28 13:33:45.000000000 +0200 @@ -38,7 +38,11 @@ self._project = None if check and not any([self.is_project, self.is_package]): - msg = f"Directory '{self.path}' is not a GIT working copy" + msg = f"Directory '{self.path}' is not a Git SCM working copy" + raise oscerr.NoWorkingCopy(msg) + + if check and not self.scmurl: + msg = f"Directory '{self.path}' is a Git SCM repo that lacks the 'origin' remote" raise oscerr.NoWorkingCopy(msg) # TODO: decide if we need explicit 'git lfs pull' or not @@ -46,12 +50,12 @@ def assert_is_project(self): if not self.is_project: - msg = f"Directory '{self.path}' is not a GIT working copy of a project" + msg = f"Directory '{self.path}' is not a Git SCM working copy of a project" raise oscerr.NoWorkingCopy(msg) def assert_is_package(self): if not self.is_package: - msg = f"Directory '{self.path}' is not a GIT working copy of a package" + msg = f"Directory '{self.path}' is not a Git SCM working copy of a package" raise oscerr.NoWorkingCopy(msg) def _run_git(self, args): @@ -148,4 +152,7 @@ @property def scmurl(self): - return self._run_git(["remote", "get-url", "origin"]) + try: + return self._run_git(["remote", "get-url", "origin"]) + except subprocess.CalledProcessError: + return None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-1.3.0/osc/store.py new/osc-1.3.1/osc/store.py --- old/osc-1.3.0/osc/store.py 2023-08-09 13:34:16.000000000 +0200 +++ new/osc-1.3.1/osc/store.py 2023-08-28 13:33:45.000000000 +0200 @@ -40,7 +40,7 @@ self.is_package = self.exists("_project") and self.exists("_package") if check and not any([self.is_project, self.is_package]): - msg = f"Directory '{self.path}' is not a working copy" + msg = f"Directory '{self.path}' is not an OBS SCM working copy" raise oscerr.NoWorkingCopy(msg) def __contains__(self, fn): @@ -52,12 +52,12 @@ def assert_is_project(self): if not self.is_project: - msg = f"Directory '{self.path}' is not a working copy of a project" + msg = f"Directory '{self.path}' is not an OBS SCM working copy of a project" raise oscerr.NoWorkingCopy(msg) def assert_is_package(self): if not self.is_package: - msg = f"Directory '{self.path}' is not a working copy of a package" + msg = f"Directory '{self.path}' is not an OBS SCM working copy of a package" raise oscerr.NoWorkingCopy(msg) def get_path(self, fn, subdir=None): @@ -317,14 +317,19 @@ - Store for OBS SCM - GitStore for Git SCM """ - try: + + # if there are '.osc' and '.git' directories next to each other, '.osc' takes preference + if os.path.exists(os.path.join(path, ".osc")): store = Store(path, check) - except oscerr.NoWorkingCopy as ex: - try: - store = git_scm.GitStore(path, check) - if print_warnings: - git_scm.warn_experimental() - except oscerr.NoWorkingCopy as ex_git: - # raise the original exception, do not inform that we've tried git working copy - raise ex from None + elif os.path.exists(os.path.join(path, ".git")): + store = git_scm.GitStore(path, check) + if print_warnings: + git_scm.warn_experimental() + else: + store = None + + if not store: + msg = f"Directory '{path}' is not a working copy" + raise oscerr.NoWorkingCopy(msg) + return store diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-1.3.0/osc/util/git_version.py new/osc-1.3.1/osc/util/git_version.py --- old/osc-1.3.0/osc/util/git_version.py 2023-08-09 13:34:16.000000000 +0200 +++ new/osc-1.3.1/osc/util/git_version.py 2023-08-28 13:33:45.000000000 +0200 @@ -9,7 +9,7 @@ """ # the `version` variable contents get substituted during `git archive` # it requires adding this to .gitattributes: <path to this file> export-subst - version = "1.3.0" + version = "1.3.1" if version.startswith(("$", "%")): # "$": version hasn't been substituted during `git archive` # "%": "Format:" and "$" characters get removed from the version string (a GitHub bug?) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-1.3.0/tests/test_conf.py new/osc-1.3.1/tests/test_conf.py --- old/osc-1.3.0/tests/test_conf.py 2023-08-09 13:34:16.000000000 +0200 +++ new/osc-1.3.1/tests/test_conf.py 2023-08-28 13:33:45.000000000 +0200 @@ -1,56 +1,393 @@ -import importlib import os +import shutil +import tempfile import unittest import osc.conf -FIXTURES_DIR = os.path.join(os.path.dirname(__file__), "conf_fixtures") +OSCRC = """ +[general] +apiurl = https://api.opensuse.org +user = Admin +pass = opensuse +passx = unused +sshkey = ~/.ssh/id_rsa.pub +packagecachedir = /var/tmp/osbuild-packagecache +su-wrapper = sudo +build-cmd = /usr/bin/build +build-type = kvm +build-root = /var/tmp/build-root/%(repo)s-%(arch)s +build-uid = 1000:1000 +build-device = /dev/null +build-memory = 1024 +build-shell-after-fail = 0 +build-swap = /tmp/build-swap +build-vmdisk-rootsize = 10240 +build-vmdisk-swapsize = 512 +build-vmdisk-filesystem = ext4 +build-vm-user = abuild +build-kernel = /boot/vmlinuz +build-initrd = /boot/initrd +download-assets-cmd = /usr/lib/build/download_assets +build-jobs = 4 +builtin_signature_check = 1 +icecream = 0 +ccache = 0 +sccache = 0 +sccache_uri = file:///var/tmp/osbuild-sccache +buildlog_strip_time = 0 +debug = 0 +http_debug = 0 +http_full_debug = 0 +http_retries = 3 +verbose = 0 +no_preinstallimage = 0 +traceback = 0 +post_mortem = 0 +use_keyring = 0 +cookiejar = ~/.local/state/osc/cookiejar +no_verify = 0 +disable_hdrmd5_check = 0 +do_package_tracking = 1 +extra-pkgs = vim strace +build_repository = openSUSE_Factory +getpac_default_project = openSUSE:Factory +checkout_no_colon = 0 +project_separator = : +checkout_rooted = 0 +exclude_glob = .osc CVS .svn .* _linkerror *~ #*# *.orig *.bak *.changes.vctmp.* +print_web_links = 0 +request_list_days = 0 +check_filelist = 1 +check_for_request_on_action = 1 +submitrequest_on_accept_action = cleanup +request_show_interactive = 0 +request_show_source_buildstatus = 0 +review_inherit_group = 0 +submitrequest_accepted_template = bla bla +submitrequest_declined_template = bla bla +linkcontrol = 0 +include_request_from_project = 1 +local_service_run = 1 +maintained_attribute = OBS:Maintained +maintenance_attribute = OBS:MaintenanceProject +maintained_update_project_attribute = OBS:UpdateProject +show_download_progress = 0 +vc-cmd = /usr/lib/build/vc +status_mtime_heuristic = 0 + +[https://api.opensuse.org] +credentials_mgr_class=osc.credentials.PlaintextConfigFileCredentialsManager +user = Admin +pass = opensuse +passx = unused +aliases = osc +http_headers = + authorization: Basic QWRtaW46b3BlbnN1c2U= +realname = The Administrator +email = ad...@example.com +sslcertck = 1 +cafile = unused +capath = unused +trusted_prj = openSUSE:* SUSE:* +downloadurl = http://example.com/ +sshkey = ~/.ssh/id_rsa.pub +disable_hdrmd5_check = 0 +""" -class TestConf(unittest.TestCase): +class TestExampleConfig(unittest.TestCase): def setUp(self): - # reset the global `config` in preparation for running the tests - importlib.reload(osc.conf) + self.tmpdir = tempfile.mkdtemp(prefix="osc_test_") + self.oscrc = os.path.join(self.tmpdir, "oscrc") + with open(self.oscrc, "w", encoding="utf-8") as f: + f.write(OSCRC) + osc.conf.get_config(override_conffile=self.oscrc) + self.config = osc.conf.config def tearDown(self): - # reset the global `config` to avoid impacting tests from other classes - importlib.reload(osc.conf) + shutil.rmtree(self.tmpdir) - def _get_fixtures_dir(self): - return FIXTURES_DIR + def test_apiurl(self): + self.assertEqual(self.config["apiurl"], "https://api.opensuse.org") - def test_bool_opts_defaults(self): - config = osc.conf.config - for opt in osc.conf._boolean_opts: - if opt not in config: - continue - self.assertIsInstance(config[opt], bool, msg=f"option: '{opt}'") - - def test_int_opts_defaults(self): - config = osc.conf.config - for opt in osc.conf._integer_opts: - if opt not in config: - continue - self.assertIsInstance(config[opt], int, msg=f"option: '{opt}'") - - def test_bool_opts(self): - oscrc = os.path.join(self._get_fixtures_dir(), "oscrc") - osc.conf.get_config(override_conffile=oscrc, override_no_keyring=True) - config = osc.conf.config - for opt in osc.conf._boolean_opts: - if opt not in config: - continue - self.assertIsInstance(config[opt], bool, msg=f"option: '{opt}'") - - def test_int_opts(self): - oscrc = os.path.join(self._get_fixtures_dir(), "oscrc") - osc.conf.get_config(override_conffile=oscrc, override_no_keyring=True) - config = osc.conf.config - for opt in osc.conf._integer_opts: - if opt not in config: - continue - self.assertIsInstance(config[opt], int, msg=f"option: '{opt}'") + def test_user(self): + self.assertEqual(self.config["user"], "Admin") + + def test_pass(self): + self.assertEqual(self.config["pass"], "opensuse") + + def test_passx(self): + self.assertEqual(self.config["passx"], "unused") + + def test_sshkey(self): + self.assertEqual(self.config["sshkey"], "~/.ssh/id_rsa.pub") + + def test_packagecachedir(self): + self.assertEqual(self.config["packagecachedir"], "/var/tmp/osbuild-packagecache") + + def test_su_wrapper(self): + self.assertEqual(self.config["su-wrapper"], "sudo") + + def test_build_cmd(self): + self.assertEqual(self.config["build-cmd"], "/usr/bin/build") + + def test_build_type(self): + self.assertEqual(self.config["build-type"], "kvm") + + def test_build_root(self): + self.assertEqual(self.config["build-root"], "/var/tmp/build-root/%(repo)s-%(arch)s") + + def test_build_uid(self): + self.assertEqual(self.config["build-uid"], "1000:1000") + + def test_build_device(self): + self.assertEqual(self.config["build-device"], "/dev/null") + + def test_build_memory(self): + self.assertEqual(self.config["build-memory"], 1024) + + def test_build_shell_after_fail(self): + self.assertEqual(self.config["build-shell-after-fail"], False) + + def test_build_swap(self): + self.assertEqual(self.config["build-swap"], "/tmp/build-swap") + + def test_build_vmdisk_rootsize(self): + self.assertEqual(self.config["build-vmdisk-rootsize"], 10240) + + def test_build_vmdisk_swapsize(self): + self.assertEqual(self.config["build-vmdisk-swapsize"], 512) + + def test_build_vmdisk_filesystem(self): + self.assertEqual(self.config["build-vmdisk-filesystem"], "ext4") + + def test_build_vm_user(self): + self.assertEqual(self.config["build-vm-user"], "abuild") + + def test_build_kernel(self): + self.assertEqual(self.config["build-kernel"], "/boot/vmlinuz") + + def test_build_initrd(self): + self.assertEqual(self.config["build-initrd"], "/boot/initrd") + + def test_download_assets_cmd(self): + self.assertEqual(self.config["download-assets-cmd"], "/usr/lib/build/download_assets") + + def test_build_jobs(self): + self.assertEqual(self.config["build-jobs"], 4) + + def test_builtin_signature_check(self): + self.assertEqual(self.config["builtin_signature_check"], True) + + def test_icecream(self): + self.assertEqual(self.config["icecream"], 0) + + def test_ccache(self): + self.assertEqual(self.config["ccache"], False) + + def test_sccache(self): + self.assertEqual(self.config["sccache"], False) + + def test_sccache_uri(self): + self.assertEqual(self.config["sccache_uri"], "file:///var/tmp/osbuild-sccache") + + def test_buildlog_strip_time(self): + self.assertEqual(self.config["buildlog_strip_time"], False) + + def test_debug(self): + self.assertEqual(self.config["debug"], False) + + def test_http_debug(self): + self.assertEqual(self.config["http_debug"], False) + + def test_http_full_debug(self): + self.assertEqual(self.config["http_full_debug"], False) + + def test_http_retries(self): + self.assertEqual(self.config["http_retries"], 3) + + def test_verbose(self): + self.assertEqual(self.config["verbose"], False) + + def test_no_preinstallimage(self): + self.assertEqual(self.config["no_preinstallimage"], False) + + def test_traceback(self): + self.assertEqual(self.config["traceback"], False) + + def test_post_mortem(self): + self.assertEqual(self.config["post_mortem"], False) + + def test_use_keyring(self): + self.assertEqual(self.config["use_keyring"], False) + + def test_cookiejar(self): + self.assertEqual(self.config["cookiejar"], "~/.local/state/osc/cookiejar") + + def test_no_verify(self): + self.assertEqual(self.config["no_verify"], False) + + def test_disable_hdrmd5_check(self): + self.assertEqual(self.config["disable_hdrmd5_check"], False) + + def test_do_package_tracking(self): + self.assertEqual(self.config["do_package_tracking"], True) + + def test_extra_pkgs(self): + self.assertEqual(self.config["extra-pkgs"], ["vim", "strace"]) + + def test_build_repository(self): + self.assertEqual(self.config["build_repository"], "openSUSE_Factory") + + def test_getpac_default_project(self): + self.assertEqual(self.config["getpac_default_project"], "openSUSE:Factory") + + def test_checkout_no_colon(self): + self.assertEqual(self.config["checkout_no_colon"], False) + + def test_project_separator(self): + self.assertEqual(self.config["project_separator"], ":") + + def test_checkout_rooted(self): + self.assertEqual(self.config["checkout_rooted"], False) + + def test_exclude_glob(self): + self.assertEqual( + self.config["exclude_glob"], + [ + ".osc", + "CVS", + ".svn", + ".*", + "_linkerror", + "*~", + "#*#", + "*.orig", + "*.bak", + "*.changes.vctmp.*", + ], + ) + + def test_print_web_links(self): + self.assertEqual(self.config["print_web_links"], False) + + def test_request_list_days(self): + self.assertEqual(self.config["request_list_days"], 0) + + def test_check_filelist(self): + self.assertEqual(self.config["check_filelist"], True) + + def test_check_for_request_on_action(self): + self.assertEqual(self.config["check_for_request_on_action"], True) + + def test_submitrequest_on_accept_action(self): + self.assertEqual(self.config["submitrequest_on_accept_action"], "cleanup") + + def test_request_show_interactive(self): + self.assertEqual(self.config["request_show_interactive"], False) + + def test_request_show_source_buildstatus(self): + self.assertEqual(self.config["request_show_source_buildstatus"], False) + + def test_review_inherit_group(self): + self.assertEqual(self.config["review_inherit_group"], False) + + def test_submitrequest_accepted_template(self): + self.assertEqual(self.config["submitrequest_accepted_template"], "bla bla") + + def test_submitrequest_declined_template(self): + self.assertEqual(self.config["submitrequest_declined_template"], "bla bla") + + def test_linkcontrol(self): + self.assertEqual(self.config["linkcontrol"], False) + + def test_include_request_from_project(self): + self.assertEqual(self.config["include_request_from_project"], True) + + def test_local_service_run(self): + self.assertEqual(self.config["local_service_run"], True) + + def test_maintained_attribute(self): + self.assertEqual(self.config["maintained_attribute"], "OBS:Maintained") + + def test_maintenance_attribute(self): + self.assertEqual(self.config["maintenance_attribute"], "OBS:MaintenanceProject") + + def test_maintained_update_project_attribute(self): + self.assertEqual(self.config["maintained_update_project_attribute"], "OBS:UpdateProject") + + def test_show_download_progress(self): + self.assertEqual(self.config["show_download_progress"], False) + + def test_vc_cmd(self): + self.assertEqual(self.config["vc-cmd"], "/usr/lib/build/vc") + + def test_status_mtime_heuristic(self): + self.assertEqual(self.config["status_mtime_heuristic"], False) + + def test_host_option_user(self): + host_options = self.config["api_host_options"][self.config["apiurl"]] + self.assertEqual(host_options["user"], "Admin") + + def test_host_option_pass(self): + host_options = self.config["api_host_options"][self.config["apiurl"]] + self.assertEqual(host_options["pass"], "opensuse") + + def test_host_option_http_headers(self): + host_options = self.config["api_host_options"][self.config["apiurl"]] + self.assertEqual( + host_options["http_headers"], + [("authorization", "Basic QWRtaW46b3BlbnN1c2U=")], + ) + + def test_host_option_realname(self): + host_options = self.config["api_host_options"][self.config["apiurl"]] + self.assertEqual(host_options["realname"], "The Administrator") + + def test_host_option_email(self): + host_options = self.config["api_host_options"][self.config["apiurl"]] + self.assertEqual(host_options["email"], "ad...@example.com") + + def test_host_option_sslcertck(self): + host_options = self.config["api_host_options"][self.config["apiurl"]] + self.assertEqual(host_options["sslcertck"], True) + + def test_host_option_cafile(self): + host_options = self.config["api_host_options"][self.config["apiurl"]] + self.assertEqual(host_options["cafile"], "unused") + + def test_host_option_capath(self): + host_options = self.config["api_host_options"][self.config["apiurl"]] + self.assertEqual(host_options["capath"], "unused") + + def test_host_option_sshkey(self): + host_options = self.config["api_host_options"][self.config["apiurl"]] + self.assertEqual(host_options["sshkey"], "~/.ssh/id_rsa.pub") + + def test_host_option_credentials_mgr_class(self): + host_options = self.config["api_host_options"][self.config["apiurl"]] + self.assertEqual( + host_options["credentials_mgr_class"], + "osc.credentials.PlaintextConfigFileCredentialsManager", + ) + + def test_host_option_allow_http(self): + host_options = self.config["api_host_options"][self.config["apiurl"]] + self.assertEqual(host_options["allow_http"], False) + + def test_host_option_trusted_prj(self): + host_options = self.config["api_host_options"][self.config["apiurl"]] + self.assertEqual(host_options["trusted_prj"], ["openSUSE:*", "SUSE:*"]) + + def test_host_option_downloadurl(self): + host_options = self.config["api_host_options"][self.config["apiurl"]] + self.assertEqual(host_options["downloadurl"], "http://example.com/") + + def test_host_option_disable_hdrmd5_check(self): + host_options = self.config["api_host_options"][self.config["apiurl"]] + self.assertEqual(host_options["disable_hdrmd5_check"], False) if __name__ == "__main__": ++++++ osc.dsc ++++++ --- /var/tmp/diff_new_pack.NBSO8g/_old 2023-08-28 17:17:49.142260941 +0200 +++ /var/tmp/diff_new_pack.NBSO8g/_new 2023-08-28 17:17:49.146261084 +0200 @@ -1,6 +1,6 @@ Format: 1.0 Source: osc -Version: 1.3.0-0 +Version: 1.3.1-0 Binary: osc Maintainer: Adrian Schroeter <adr...@suse.de> Architecture: any