Hello Dan,

wt., 5 paź 2021 o 17:41 Dan Langille <d...@langille.org> napisał(a):

>
> Dan Langille wrote:
>
>
> Hello,
>
> Is it time to update the regression tests from Python 2 to Python3?
>
> e.g.
>
> [pg14 dan ~/src/bacula/regress] % grep -r python2 * 14:25:49
> build/release/bgit.py:#!/usr/bin/env python2
> test_duration:#!/usr/bin/env python2
> ^C
>
> This is not a complete list.
>
>
>
> I have started moving my regression testing hosts from 9.x to 11.x and I'm
> finding things which need improvement.
>
> Following on from this, I am finding other things which are breaking
> regression testing on non-Linux systems.
>
> The first: do not assume /bin/bash exists
>
> [pg14 dan ~/src/bacula/regress] % git diff
> scripts/cleanup                                       15:11:00
> diff --git a/regress/scripts/cleanup b/regress/scripts/cleanup
> index 6cc332a16..fbeb28025 100755
> --- a/regress/scripts/cleanup
> +++ b/regress/scripts/cleanup
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
> #
> # Copyright (C) 2000-2020 Kern Sibbald
> # License: BSD 2-Clause; see file LICENSE-FOSS
> [pg14 dan ~/src/bacula/regress]
> %                                                                15:11:07
>
> This same problem also affects regress/scripts/regress-utils.sh
>
> Next, do not assume /bin/bash is the bash you are using. On some systems,
> it is /usr/local/bin/bash.
>
> Deeper into regress/scripts/regress-utils.sh, is found:
>
> # now check if we are running under a proper shell
> if test "x$SHELL" != "x/bin/bash"
> then
>   echo "Regression script must use BASH for this utilities!"
>   exit 1
> fi
>
> This will fail on my system for sure and others I'm sure.  I think for two
> reasons:
>
> 1 - $SHELL is an environment variable - it is not the shell running this
> script
>

For bash it is a shell running the script.


> 2 - bash is not always /bin/bash
>

???


>
> Must I be running the bash shell to invoke regression testing? If so, why?
>

I do not understand your question. Regression testing requires some special
configuration of the system where you perform tests and are not expected to
be executed on the production system or distributed with the
package manager of your choice.
So if you want to perform regression testing you have to
correctly setup your environment, right? It is not a secret that the main
Bacula development is done on Linux systems, so the regressions.


> Regression testing is vital to the project. At present, regression will
> work only on a limited number of operating systems.
>

As long as regression testing will be the mix of shell (different brands),
perl, sed, awk and python scripts then it won't change.
A few years ago regression tests won't run when the source directory name
contains a dot. :)

I'm hoping we can change that soon.
>
I'm happy to send in pull requests soon.
>

Great! Can't wait!

best regards
-- 
Radosław Korzeniewski
rados...@korzeniewski.net
_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to