lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 20 Oct 2020 08:52:31 +0200
From:   SeongJae Park <sjpark@...zon.com>
To:     SeongJae Park <sjpark@...zon.com>
CC:     <brendanhiggins@...gle.com>, SeongJae Park <sjpark@...zon.de>,
        <skhan@...uxfoundation.org>, <linux-kselftest@...r.kernel.org>,
        <kunit-dev@...glegroups.com>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] kunit: tool: Mark 'kunittest_config' as constant again

ping

On Mon, 12 Oct 2020 12:26:21 +0200 SeongJae Park <sjpark@...zon.com> wrote:

> From: SeongJae Park <sjpark@...zon.de>
> 
> 'kunit_kernel.kunittest_config' was constant at first, and therefore it
> used UPPER_SNAKE_CASE naming convention that usually means it is
> constant in Python world.  But, commit e3212513a8f0 ("kunit: Create
> default config in '--build_dir'") made it modifiable to fix a use case
> of the tool and thus the naming also changed to lower_snake_case.
> However, this resulted in a confusion.  As a result, some successing
> changes made the tool unittest fail, and a fix[1] of it again incurred
> the '--build_dir' use case failure.
> 
> As the previous commit fixed the '--build_dir' use case without
> modifying the variable again, this commit marks the variable as constant
> again with UPPER_SNAKE_CASE, to reduce future confusions.
> 
> [1] Commit d43c7fb05765 ("kunit: tool: fix improper treatment of file location")
> 
> Signed-off-by: SeongJae Park <sjpark@...zon.de>
> ---
>  tools/testing/kunit/kunit.py        | 4 ++--
>  tools/testing/kunit/kunit_kernel.py | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py
> index 611c23e178f8..0a58c1fb87d9 100755
> --- a/tools/testing/kunit/kunit.py
> +++ b/tools/testing/kunit/kunit.py
> @@ -44,9 +44,9 @@ class KunitStatus(Enum):
>  	TEST_FAILURE = auto()
>  
>  def create_default_kunitconfig():
> -	if not os.path.exists(kunit_kernel.kunitconfig_path):
> +	if not os.path.exists(kunit_kernel.KUNITCONFIG_PATH):
>  		shutil.copyfile('arch/um/configs/kunit_defconfig',
> -				kunit_kernel.kunitconfig_path)
> +				kunit_kernel.KUNITCONFIG_PATH)
>  
>  def get_kernel_root_path():
>  	parts = sys.argv[0] if not __file__ else __file__
> diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py
> index 16a997504317..42dca0163479 100644
> --- a/tools/testing/kunit/kunit_kernel.py
> +++ b/tools/testing/kunit/kunit_kernel.py
> @@ -18,7 +18,7 @@ import kunit_config
>  import kunit_parser
>  
>  KCONFIG_PATH = '.config'
> -kunitconfig_path = '.kunitconfig'
> +KUNITCONFIG_PATH = '.kunitconfig'
>  BROKEN_ALLCONFIG_PATH = 'tools/testing/kunit/configs/broken_on_uml.config'
>  
>  class ConfigError(Exception):
> @@ -106,7 +106,7 @@ class LinuxSourceTree(object):
>  
>  	def __init__(self, build_dir):
>  		self._kconfig = kunit_config.Kconfig()
> -		self._kconfig.read_from_file(os.path.join(build_dir, kunitconfig_path))
> +		self._kconfig.read_from_file(os.path.join(build_dir, KUNITCONFIG_PATH))
>  		self._ops = LinuxSourceTreeOperations()
>  		signal.signal(signal.SIGINT, self.signal_handler)
>  
> -- 
> 2.17.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ