[autotest][PATCH] Revert "UBUNTU: SAUCE: fix missing setup on second run"
Krzysztof Kozlowski
krzysztof.kozlowski at canonical.com
Tue Jun 8 06:19:27 UTC 2021
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 at canonical.com>
---
client/shared/utils.py | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
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'))
--
2.27.0
More information about the kernel-team
mailing list