diff mbox series

[autotest] Revert "UBUNTU: SAUCE: fix missing setup on second run"

Message ID 20210608061927.4744-1-krzysztof.kozlowski@canonical.com
State New
Headers show
Series [autotest] Revert "UBUNTU: SAUCE: fix missing setup on second run" | expand

Commit Message

Krzysztof Kozlowski June 8, 2021, 6:19 a.m. UTC
This reverts commit f6e444df45f45fccd3b18f098233e5c4fabe1153.

The change looks incorrect because it makes the setup() basically the
same as initialize() callback.  Instead each test should be fixed so on
next runs it will work with setup() being called only once.

This change also breaks several tests which do not clean after setup()
or are not prepared for resources already prepared, like "git clone".
For example ubuntu_ltp_syscalls:

    INFO | START	----	----	timestamp=1623064688	localtime=Jun 07 11:18:08
    DEBUG| Persistent state client._record_indent now set to 1
    DEBUG| Test has timeout: 1800 sec.
    INFO | 	START	ubuntu_ltp_syscalls.setup	ubuntu_ltp_syscalls.setup	timestamp=1623064688	timeout=1800	localtime=Jun 07
    ...
    DEBUG| Running 'git clone https://github.com/linux-test-project/ltp.git'
    ERROR| [stderr] fatal: destination path 'ltp' already exists and is not an empty directory.
    ERROR| Exception escaping from test:
    Traceback (most recent call last):
      File "/home/ubuntu/autotest/client/shared/test.py", line 387, in _exec
        *p_args, **p_dargs)
      File "/home/ubuntu/autotest/client/shared/utils.py", line 868, in update_version
        install(*args, **dargs)
      File "/home/ubuntu/autotest/client/tests/ubuntu_ltp_syscalls/ubuntu_ltp_syscalls.py", line 85, in setup
        self.results = utils.system_output(cmd, retain_output=True)
      File "/home/ubuntu/autotest/client/shared/utils.py", line 1271, in system_output
        verbose=verbose, args=args).stdout
      File "/home/ubuntu/autotest/client/shared/utils.py", line 922, in run
        "Command returned non-zero exit status")
    CmdError: Command <git clone https://github.com/linux-test-project/ltp.git> failed, rc=128, Command returned non-zero exit status
    * Command:
        git clone https://github.com/linux-test-project/ltp.git

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
---
 client/shared/utils.py | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Po-Hsu Lin June 9, 2021, 1:36 a.m. UTC | #1
Acked-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Applied and pushed.

Thanks
Sam
diff mbox series

Patch

diff --git a/client/shared/utils.py b/client/shared/utils.py
index 367edcd04a03..3e8c9448d23e 100644
--- a/client/shared/utils.py
+++ b/client/shared/utils.py
@@ -862,11 +862,7 @@  def update_version(srcdir, preserve_srcdir, new_version, install,
                                      os.path.basename(patch_src))
             shutil.copyfile(patch_src, patch_dst)
 
-    # The test-specific setup is always needed because:
-    #  - it could have been reverted with cleanup()
-    #  - few broken tests might depend on setup() run always
-    install(*args, **dargs)
-    if install_needed:
+        install(*args, **dargs)
         pickle.dump(new_version, open(versionfile, 'w'))