Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
Cleber Rosa
c3d827aabd Update to version 92.0
The current packaged version from upstream matches the Long Term
Stability (LTS) release 82.0, which is about to be EOLed upstream.
This updates the pacakge to track the latest and current LTS release.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
2022-08-10 11:47:46 -04:00
Cleber Rosa
39911db53d Sync gdbtest.py with latest upstream
Signed-off-by: Cleber Rosa <crosa@redhat.com>
2022-08-10 11:47:38 -04:00
5 changed files with 72 additions and 146 deletions

1
.gitignore vendored
View file

@ -28,3 +28,4 @@
/avocado-79.0.tar.gz
/avocado-80.0.tar.gz
/avocado-82.0.tar.gz
/avocado-92.0.tar.gz

View file

@ -9,10 +9,10 @@
%global gittar avocado-%{version}.tar.gz
%else
%if ! 0%{?commit:1}
%global commit e97540793998c4f24a16000465dd7fdd213bf2b9
%global commit 08ac79fa4ecaee60d7d5211d9634568b5545bdcd
%endif
%if ! 0%{?commit_date:1}
%global commit_date 20200911
%global commit_date 20211019
%endif
%global shortcommit %(c=%{commit};echo ${c:0:9})
%global gitrel .%{commit_date}git%{shortcommit}
@ -34,8 +34,8 @@
%endif
Name: python-avocado
Version: 82.0
Release: 7%{?gitrel}%{?dist}
Version: 92.0
Release: 1%{?gitrel}%{?dist}
Summary: Framework with tools and libraries for Automated Testing
# Found licenses:
# avocado/core/tapparser.py: MIT
@ -104,9 +104,6 @@ popd
pushd optional_plugins/varianter_yaml_to_mux
%py3_build
popd
pushd optional_plugins/loader_yaml
%py3_build
popd
pushd optional_plugins/golang
%py3_build
popd
@ -119,9 +116,6 @@ popd
pushd optional_plugins/result_upload
%py3_build
popd
pushd optional_plugins/glib
%py3_build
popd
rst2man man/avocado.rst man/avocado.1
%install
@ -130,11 +124,14 @@ for exe in \
avocado \
avocado-runner \
avocado-runner-noop \
avocado-runner-exec \
avocado-runner-dry-run \
avocado-runner-exec-test \
avocado-runner-python-unittest \
avocado-runner-avocado-instrumented \
avocado-runner-tap \
avocado-runner-requirement-asset \
avocado-runner-requirement-package \
avocado-runner-sysinfo \
avocado-software-manager
do
mv %{buildroot}%{_bindir}/$exe %{buildroot}%{_bindir}/$exe-%{python3_version}
@ -160,9 +157,6 @@ popd
pushd optional_plugins/varianter_yaml_to_mux
%py3_install
popd
pushd optional_plugins/loader_yaml
%py3_install
popd
pushd optional_plugins/golang
%py3_install
popd
@ -175,9 +169,6 @@ popd
pushd optional_plugins/result_upload
%py3_install
popd
pushd optional_plugins/glib
%py3_install
popd
# cleanup plugin test cruft
rm -rf %{buildroot}%{python3_sitelib}/tests
mkdir -p %{buildroot}%{_sysconfdir}/avocado
@ -203,7 +194,6 @@ cp -r examples/varianter_cit %{buildroot}%{_docdir}/avocado/varianter_cit
cp -r examples/varianter_pict %{buildroot}%{_docdir}/avocado/varianter_pict
cp -r examples/wrappers %{buildroot}%{_docdir}/avocado/wrappers
cp -r examples/yaml_to_mux %{buildroot}%{_docdir}/avocado/yaml_to_mux
cp -r examples/yaml_to_mux_loader %{buildroot}%{_docdir}/avocado/yaml_to_mux_loader
find %{buildroot}%{_docdir}/avocado -type f -name '*.py' -exec chmod -c -x {} ';'
@ -218,7 +208,9 @@ find %{buildroot}%{_docdir}/avocado -type f -name '*.py' -exec chmod -c -x {} ';
PYTHONPATH=%{buildroot}%{python3_sitelib}:. \
LANG=en_US.UTF-8 \
AVOCADO_CHECK_LEVEL=0 \
%{python3} selftests/run
%{python3} selftests/check.py --job-api --nrunner-interface \
--unit --jobs --functional --optional-plugins \
--disable-plugin-checks robot
%endif
@ -250,9 +242,9 @@ these days a framework) to perform automated testing.
%{_bindir}/avocado-runner-noop-%{python3_version}
%{_bindir}/avocado-runner-noop-3
%{_bindir}/avocado-runner-noop
%{_bindir}/avocado-runner-exec-%{python3_version}
%{_bindir}/avocado-runner-exec-3
%{_bindir}/avocado-runner-exec
%{_bindir}/avocado-runner-dry-run-%{python3_version}
%{_bindir}/avocado-runner-dry-run-3
%{_bindir}/avocado-runner-dry-run
%{_bindir}/avocado-runner-exec-test-%{python3_version}
%{_bindir}/avocado-runner-exec-test-3
%{_bindir}/avocado-runner-exec-test
@ -265,6 +257,15 @@ these days a framework) to perform automated testing.
%{_bindir}/avocado-runner-tap-%{python3_version}
%{_bindir}/avocado-runner-tap-3
%{_bindir}/avocado-runner-tap
%{_bindir}/avocado-runner-requirement-asset-%{python3_version}
%{_bindir}/avocado-runner-requirement-asset-3
%{_bindir}/avocado-runner-requirement-asset
%{_bindir}/avocado-runner-requirement-package-%{python3_version}
%{_bindir}/avocado-runner-requirement-package-3
%{_bindir}/avocado-runner-requirement-package
%{_bindir}/avocado-runner-sysinfo-%{python3_version}
%{_bindir}/avocado-runner-sysinfo-3
%{_bindir}/avocado-runner-sysinfo
%{_bindir}/avocado-software-manager-%{python3_version}
%{_bindir}/avocado-software-manager-3
%{_bindir}/avocado-software-manager
@ -341,20 +342,6 @@ defined in a yaml file(s).
%{python3_sitelib}/avocado_framework_plugin_varianter_yaml_to_mux-%{version}-py%{python3_version}.egg-info
%package -n python3-avocado-plugins-loader-yaml
Summary: Avocado plugin that loads tests from YAML files
License: GPLv2+
Requires: python3-avocado-plugins-varianter-yaml-to-mux == %{version}-%{release}
%description -n python3-avocado-plugins-loader-yaml
Can be used to produce a test suite from definitions in a YAML file,
similar to the one used in the yaml_to_mux varianter plugin.
%files -n python3-avocado-plugins-loader-yaml
%{python3_sitelib}/avocado_loader_yaml/
%{python3_sitelib}/avocado_framework_plugin_loader_yaml-%{version}-py%{python3_version}.egg-info
%package -n python3-avocado-plugins-golang
Summary: Avocado plugin for execution of golang tests
License: GPLv2+
@ -368,6 +355,7 @@ also run them.
%files -n python3-avocado-plugins-golang
%{python3_sitelib}/avocado_golang/
%{python3_sitelib}/avocado_framework_plugin_golang-%{version}-py%{python3_version}.egg-info
%{_bindir}/avocado-runner-golang
%package -n python3-avocado-plugins-varianter-pict
@ -413,20 +401,6 @@ a dedicated sever.
%{python3_sitelib}/avocado_framework_plugin_result_upload-%{version}-py%{python3_version}.egg-info
%package -n python3-avocado-plugins-glib
Summary: Avocado plugin for execution of GLib Test Framework tests
License: GPLv2+
Requires: python3-avocado == %{version}-%{release}
%description -n python3-avocado-plugins-glib
This optional plugin is intended to list and run tests written in the
GLib Test Framework.
%files -n python3-avocado-plugins-glib
%{python3_sitelib}/avocado_glib/
%{python3_sitelib}/avocado_framework_plugin_glib-%{version}-py%{python3_version}.egg-info
%package -n python-avocado-examples
Summary: Avocado Test Framework Example Tests
License: GPLv2+
@ -448,7 +422,6 @@ examples of how to write tests on your own.
%{_docdir}/avocado/varianter_pict
%{_docdir}/avocado/wrappers
%{_docdir}/avocado/yaml_to_mux
%{_docdir}/avocado/yaml_to_mux_loader
%package -n python-avocado-bash
@ -471,6 +444,14 @@ Again Shell code (and possibly other similar shells).
%changelog
* Tue Aug 9 2022 Cleber Rosa <crosa@redhat.com> - 92.0-1
- Use selftests/check.py job instead of more limited selftests/run
- Included avocado-runner-sysinfo, avocado-runner-requirement-package,
avocado-runner-requirement-asset and avocado-runner-dry-run and
avocado-runner-golang executables
- Removed avocado-runner-exec executable
- Removed loader_yaml and glib plugin packages
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 82.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

View file

@ -1 +1 @@
SHA512 (avocado-82.0.tar.gz) = 099ab131b2b941602550e71507e4ca517d5d2cd5152b255edace0473c9de93aac8163a61689414b5b58f9211f58981c3c30c1c3ca8a191283f609722ce07f173
SHA512 (avocado-92.0.tar.gz) = 87d424098b26d12cbe14ffc509616c2114c7b549801582593568f94ca181373f0398290cb9569645c40d514f1ae29f77bfad94f6efb2025b1f9b8c5f2a5b7822

View file

@ -1,14 +1,7 @@
#!/usr/bin/env python
import os
from six.moves import xrange as range
from avocado import Test
from avocado import main
from avocado.utils import gdb
from avocado.utils import genio
from avocado.utils import process
from avocado.utils import gdb, genio, process
class GdbTest(Test):
@ -32,17 +25,22 @@ class GdbTest(Test):
"-auto-debug-it"]
def setUp(self):
return99_source_path = os.path.join(self.datadir, 'return99.c')
segfault_source_path = os.path.join(self.datadir, 'segfault.c')
self.return99_binary_path = os.path.join(self.outputdir, 'return99')
process.system('gcc -O0 -g %s -o %s' % (return99_source_path,
self.return99_binary_path))
self.segfault_binary_path = os.path.join(self.outputdir, 'segfault')
process.system('gcc -O0 -g %s -o %s' % (segfault_source_path,
self.segfault_binary_path))
self.return99_binary_path = os.path.join(self.teststmpdir, 'return99')
if not os.path.exists(self.return99_binary_path):
return99_source_path = self.get_data('return99.c')
if return99_source_path is None:
self.cancel('Test is missing data file "return99.c"')
process.system(f'gcc -O0 -g {return99_source_path} -o {self.return99_binary_path}')
self.segfault_binary_path = os.path.join(self.teststmpdir, 'segfault')
if not os.path.exists(self.segfault_binary_path):
segfault_source_path = self.get_data('segfault.c')
if segfault_source_path is None:
self.cancel('Test is missing data file "segfault.c"')
process.system(f'gcc -O0 -g {segfault_source_path} -o {self.segfault_binary_path}')
@staticmethod
def is_process_alive(process):
def is_process_alive(process): # pylint: disable=W0621
"""
Checks if a process is still alive
@ -73,14 +71,14 @@ class GdbTest(Test):
g = gdb.GDB()
self.log.info("Testing existing (valid) GDB commands using raw commands")
for cmd in self.VALID_CMDS:
info_cmd = "-info-gdb-mi-command %s" % cmd[1:]
info_cmd = f"-info-gdb-mi-command {cmd[1:]}"
r = g.cmd(info_cmd)
self.assertEqual(r.result.result.command.exists, 'true')
self.log.info("Testing non-existing (invalid) GDB commands using raw "
"commands")
for cmd in self.INVALID_CMDS:
info_cmd = "-info-gdb-mi-command %s" % cmd[1:]
info_cmd = f"-info-gdb-mi-command {cmd[1:]}"
r = g.cmd(info_cmd)
self.assertEqual(r.result.result.command.exists, 'false')
@ -105,7 +103,7 @@ class GdbTest(Test):
self.log.info("Testing that GDB loads a file and sets a breakpoint")
g = gdb.GDB()
file_cmd = "-file-exec-and-symbols %s" % self.return99_binary_path
file_cmd = f"-file-exec-and-symbols {self.return99_binary_path}"
r = g.cmd(file_cmd)
self.assertEqual(r.result.class_, 'done')
@ -145,7 +143,7 @@ class GdbTest(Test):
self.log.info("Testing that a core dump will be generated")
g = gdb.GDB()
file_cmd = "-file-exec-and-symbols %s" % self.segfault_binary_path
file_cmd = f"-file-exec-and-symbols {self.segfault_binary_path}"
r = g.cmd(file_cmd)
self.assertEqual(r.result.class_, 'done')
@ -156,12 +154,12 @@ class GdbTest(Test):
other_messages = g.read_until_break()
core_path = None
for msg in other_messages:
parsed_msg = gdb.parse_mi(msg)
parsed_msg = gdb.parse_mi(msg.decode())
if (hasattr(parsed_msg, 'class_') and
(parsed_msg.class_ == 'stopped') and
(parsed_msg.result.signal_name == 'SIGSEGV')):
core_path = "%s.core" % self.segfault_binary_path
gcore_cmd = 'gcore %s' % core_path
core_path = f"{self.segfault_binary_path}.core"
gcore_cmd = f'gcore {core_path}'
gcore_cmd = gdb.encode_mi_cli(gcore_cmd)
r = g.cmd(gcore_cmd)
self.assertEqual(r.result.class_, 'done')
@ -191,14 +189,14 @@ class GdbTest(Test):
# Do 100 cycle of target (kind of connects) and disconnects
for _ in range(0, 100):
cmd = '-target-select extended-remote :%s' % s.port
cmd = f'-target-select extended-remote :{s.port}'
r = g.cmd(cmd)
self.assertEqual(r.result.class_, 'connected')
r = g.cmd('-target-disconnect')
self.assertEqual(r.result.class_, 'done')
# manual server shutdown
cmd = '-target-select extended-remote :%s' % s.port
cmd = f'-target-select extended-remote :{s.port}'
r = g.cmd(cmd)
self.assertEqual(r.result.class_, 'connected')
r = g.cli_cmd('monitor exit')
@ -234,15 +232,15 @@ class GdbTest(Test):
s = gdb.GDBServer()
g = gdb.GDB()
cmd = '-file-exec-and-symbols %s' % self.return99_binary_path
cmd = f'-file-exec-and-symbols {self.return99_binary_path}'
r = g.cmd(cmd)
self.assertEqual(r.result.class_, 'done')
cmd = 'set remote exec-file %s' % self.return99_binary_path
cmd = f'set remote exec-file {self.return99_binary_path}'
r = g.cmd(cmd)
self.assertEqual(r.result.class_, 'done')
cmd = "-break-insert %s" % 'main'
cmd = f"-break-insert {'main'}"
r = g.cmd(cmd)
self.assertEqual(r.result.class_, 'done')
@ -250,7 +248,7 @@ class GdbTest(Test):
other_messages = g.read_until_break()
for msg in other_messages:
parsed_msg = gdb.parse_mi(msg)
parsed_msg = gdb.parse_mi(msg.decode())
if (hasattr(parsed_msg, 'class_') and
parsed_msg.class_ == 'stopped' and
parsed_msg.result.reason == 'breakpoint-hit'):
@ -278,7 +276,8 @@ class GdbTest(Test):
c1 = gdb.GDB()
c1.connect(s.port)
c2 = gdb.GDB()
self.assertRaises(ValueError, c2.connect, s.port)
with self.assertRaises(gdb.UnexpectedResponseError):
c2.connect(s.port)
s.exit()
def test_server_exit(self):
@ -310,43 +309,6 @@ class GdbTest(Test):
server_instances[i].exit()
self.assertFalse(self.is_process_alive(server_instances[i].process))
def test_interactive(self):
"""
Tests avocado's GDB plugin features
If GDB command line options are given, `--gdb-run-bin=return99` for
this particular test, the test will stop at binary main() function.
"""
self.log.info('Testing GDB interactivity')
process.run(self.return99_binary_path, ignore_status=True)
def test_interactive_args(self):
"""
Tests avocado's GDB plugin features with an executable and args
If GDB command line options are given, `--gdb-run-bin=return99` for
this particular test, the test will stop at binary main() function.
This test uses `process.run()` without an `ignore_status` parameter
"""
self.log.info('Testing GDB interactivity with arguments')
result = process.run("%s 0" % self.return99_binary_path)
self.assertEqual(result.exit_status, 0)
def test_exit_status(self):
"""
Tests avocado's GDB plugin features
If GDB command line options are given, `--gdb-run-bin=return99` for
this particular test, the test will stop at binary main() function.
"""
self.log.info('Testing process exit statuses')
for arg, exp in [(-1, 255), (8, 8)]:
self.log.info('Expecting exit status "%s"', exp)
cmd = "%s %s" % (self.return99_binary_path, arg)
result = process.run(cmd, ignore_status=True)
self.assertEqual(result.exit_status, exp)
def test_server_stderr(self):
self.log.info('Testing server stderr collection')
s = gdb.GDBServer()
@ -354,7 +316,7 @@ class GdbTest(Test):
self.assertTrue(os.path.exists(s.stderr_path))
stderr_lines = genio.read_all_lines(s.stderr_path)
listening_line = "Listening on port %s" % s.port
listening_line = f"Listening on port {s.port}"
self.assertIn(listening_line, stderr_lines)
def test_server_stdout(self):
@ -372,28 +334,14 @@ class GdbTest(Test):
stdout_lines = genio.read_all_lines(s.stdout_path)
self.assertIn("return 99", stdout_lines)
def test_interactive_stdout(self):
"""
Tests avocado's GDB plugin features
If GDB command line options are given, `--gdb-run-bin=return99` for
this particular test, the test will stop at binary main() function.
"""
self.log.info('Testing GDB interactivity')
result = process.run(self.return99_binary_path, ignore_status=True)
self.assertIn("return 99\n", result.stdout)
def test_remote(self):
@staticmethod
def test_remote():
"""
Tests GDBRemote interaction with a GDBServer
"""
s = gdb.GDBServer()
r = gdb.GDBRemote('127.0.0.1', s.port)
r.connect()
r.cmd("qSupported")
r.cmd("qfThreadInfo")
r.cmd(b"qSupported")
r.cmd(b"qfThreadInfo")
s.exit()
if __name__ == '__main__':
main()

View file

@ -3,8 +3,8 @@
- role: standard-test-avocado
tests:
- gdbtest.py:GdbTest.test_start_exit
- gdbtest.py:GdbTest.test_existing_commands
- gdbtest.py:GdbTest.test_existing_commands_raw
- gdbtest.py:GdbTest.test_existing_commands
- gdbtest.py:GdbTest.test_load_set_breakpoint_run_exit_raw
- gdbtest.py:GdbTest.test_load_set_breakpoint_run_exit
- gdbtest.py:GdbTest.test_generate_core
@ -15,13 +15,9 @@
- gdbtest.py:GdbTest.test_stream_messages
- gdbtest.py:GdbTest.test_connect_multiple_clients
- gdbtest.py:GdbTest.test_server_exit
- gdbtest.py:GdbTest.test_server_stdout
- gdbtest.py:GdbTest.test_server_stderr
- gdbtest.py:GdbTest.test_multiple_servers
- gdbtest.py:GdbTest.test_interactive
- gdbtest.py:GdbTest.test_interactive_args
- gdbtest.py:GdbTest.test_exit_status
- gdbtest.py:GdbTest.test_interactive_stdout
- gdbtest.py:GdbTest.test_server_stderr
- gdbtest.py:GdbTest.test_server_stdout
- gdbtest.py:GdbTest.test_remote
required_packages:
- gcc