aboutsummaryrefslogtreecommitdiffstats
path: root/tests/plugin_tests.py
Commit message (Collapse)AuthorAgeFilesLines
* [tests] Start using avocado for test suiteJake Hunsaker2021-04-151-479/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit represents the start of an overhaul of the test suite used by sos. Note that several more commits to follow will be required in order for the test suite to be considered stable. The new test suite will use the avocado-framework to build out new tests. This first part adopts a new 'stageX' naming scheme for our tests as follows: stage0 -> Unittests stage1 -> Basic function tests, no mocking allowed stage2 -> Mocked tests for specific scenarios/regressions stage3 -> Complex setups for layered products/environments At the moment, these unittests are not updated for avocado, though most should still work with `nosetest` directly. A new set of base classes is defined in tests/sos_tests.py which provide the foundation for actual tests cases. This approach entails new test cases subclassing a base class, such as the new `StageOneReportTest`, and setting the `sos_cmd` class attr to the _options_ for an sos report run. By default `sos report --batch` will be run, and targeted to the test job's directory as a tmpdir. Each sos command will be executed once, and all test_* methods within a test case that subclasses `StageOneReportTest` will be checked against the output of that execution. Note that this diverges from avocado's typical approach where each test_* method is performed against a brand new instance of the class (thus meaning any setup including our sos report run would normally be run fresh). However, after speaking with the avocado devel team, this is still seen as a valid pattern for the framework. The current organizational approach is to separate the tests by component rather than stage. For example. `tests/report_tests/` should hold any report-centric tests, and the `plugin_tests` directory therein should be used for plugin-specific tests. As of this commit, there are basic functionality tests under `tests/report_tests/` and a single plugin test under `tests/report_tests/plugin_tests/` to act as a POC. Further, there is a `tests/vendor_tests/` directory for organizing vendor-specific bug/feature tests that are not covered by the generic project-wide tests. A POC test from RHBZ1928628 is available with this commit. Note that in order for these tests to be run properly _without_ installing the current branch to the local system, you will need to run the following command: `PYTHONPATH=tests/ avocado run -t stageone tests/` Related: #2431 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [sos] Align plugin options with destination namesJake Hunsaker2021-02-031-1/+1
| | | | | | | | | | | | | This commit alters several option long-form names or destination names to align those values in a sensible way. This serves to not only remove some abiguity in option naming in code, but also to make it so that the "effective options" line logged in every sos execution can be direction copy-pasted as a working command. Closes: #2288 Resolves: #2398 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [policies] Move linux policies into new subdirJake Hunsaker2021-01-041-1/+2
| | | | | | | | | | | Moves the actual policy files for supported distributions out of `sos/policies` and into a new subdir `sos/policies/distros`. Note that `Policy()` still lives in the former, while `LinuxPolicy()` has been moved into `sos/policies/distros/__init__.py` Related: #2349 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [report] Allow users to specify commands and files to skipJake Hunsaker2020-11-031-0/+2
| | | | | | | | | | | | | | | Adds two new options, `--skip-commands` and `--skip-files`, that allow users to selectively skip specific command or file collection instead of having to disable whole plugins to skip those collections. These options are also exposed via `sos collect`, being gated by a version of 4.1 since that is the next scheduled release where we can guarantee this functionality will be present. Closes: #2203 Resolves: #2271 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [general] flake8 first passBryan Quigley2020-08-131-7/+5
| | | | | Signed-off-by: Bryan Quigley <code@bryanquigley.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [travis,style] Upgrade to 20.04 and cover more in testsBryan Quigley2020-08-131-19/+34
| | | | | Signed-off-by: Bryan Quigley <code@bryanquigley.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [plugins] Convert docstrings to class attrsJake Hunsaker2020-04-301-1/+1
| | | | | | | | | | Converts all current plugin docstrings into a `short_desc` attribute, that is now referenced by `Plugin.get_description()`. Closes: #1960 Resolves: #2036 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [tests] Fix unittestsJake Hunsaker2020-04-211-2/+2
| | | | | | | | | | Fixes a unittest failure due to an attempt to pass print() a `file` keyword for Red Hat, which is no longer accepted in python3 Additionally fixes 2 string related errors in the test suite since changing from python2 to python3. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [global] Drop use of python six and other 2.X bitsBryan Quigley2020-04-091-7/+2
| | | | | | Resolves: #2006 Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
* [global] Fix report import pathsJake Hunsaker2020-04-071-1/+1
| | | | | | | | | | | Updates the uses of 'from sos.plugins' to 'from sos.report.plugins' in order to fix imports across the project with the new tree organization. Additionally, the legacy `sosreport` binary now injects the user's current working directory into the path the python interpreter uses in order to allow local execution from a git checkout. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Plugin] Add new method for iterating over storage devicesJake Hunsaker2020-04-071-19/+38
| | | | | | | | | | | | | | | | | | | | | | | Adds a new mechanism for iterating over a list of devices with a given command or list of commands. This is to allow us to stop doing ad-hoc device enumeration in multiple plugins and instead provide a consistent behavior for iterating over devices such as disks. Before setting up plugins, sos will now enumerate a list of block devices and fibre devices that is made available to the plugins. From there the new 'add_blockdev_cmd()' method may be passed a command or list of commands that will be iterated over for every device. Commands passed need to include '%(dev)s' in the appropriate place for device name substitution. By default this will iterate over all discovered block devices. The 'devices' parameter may be used to change this, either by passing 'fibre' to instead iterate over fibre devices, or by passing a list of devices to use directly. To filter out or restrict commands to running on specific types of devices, the blacklist and whitelist parameters can be used respectively and can accept either a single regex string or a list of regexes. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Policy] Add Container Runtime abstraction classJake Hunsaker2020-04-071-32/+70
| | | | | | | | | | | | | | | | | Adds a `ContainerRuntime()` class to allow policies to specify a container runtime to allow plugins to utilize. The `ContainerRuntime` is intended to allow for the discovery of containers, including specific ones by name, and for the execution of commands inside those containers. This is meant to remove the overhead of manually defining ways to determine an active runtime and if a component is containerized within plugins. Related: #1866 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [tests] add license header to source filesBryn M. Reeves2020-02-261-0/+7
| | | | | | | Resolves: #1958 Signed-off-by: Bryn M. Reeves <bmr@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [policies] fix LinuxPolicy performance regression (test suite)Bryn M. Reeves2020-02-141-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 285873a introduces a regression in the performance of LinuxProfile class initialisation: commit 285873a4f753822a88d475a1b030ab622bf4c72e Author: Bryan Quigley <bryan.quigley@canonical.com> Date: Tue Feb 11 15:03:16 2020 -0800 [policies] Detect systemd use instead of hardcoding it All the patch does is to switch from testing self.init to determine whether to use the SystemdInit() class or the basic InitSystem() one, to looking for '/run/systemd/system' in the file system. This has more broad side effects than it might seem since the test suite uses LinuxPolicy() as a mock policy object for a large number of tests. Since SystemdInit() calls out to systemctl to obtain the state of the init system this both increases the run time for the tests and causes high resource use in systemd itself: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1 root 20 0 177196 13504 4512 R 92.7 0.1 5:24.04 systemd This causes the run time for the Python2 and 3 test suite (plus pep8/pycodestyle) to grow from ~5s to over 1m20s on my test system: 285873a~1 real 0m5.683s 285873a real 1m20.353s Allow direct users of LinuxPolicy to override the init system detection by specifying an init= kwarg initialised to an InitSystem-like object directly, and use this in the test suite to avoid the cost of initialising the full SystemdInit() class. Resolves: #1953 Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [Plugin] Allow selectively disabling postprocessingJake Hunsaker2019-11-191-0/+22
| | | | | | | | | | | | | | | | | | Adds two mechanisms by which users can choose to disable postprocessing of collected information. First, is a global method exposed via the `--no-postproc` option. Using this option will skip postprocessing for all plugins. Second, is a per-plugin option exposed via a new 'postproc' plugin option. This is set to _True_ by default (meaning yes, perform postprocessing), which users can set to False or off to disable postprocessing for that plugin only; e.g. `-k podman.postproc=off` Closes: #286 Resolves: #1862 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [tests] fix test_copy_dir_forbidden_pathBryn M. Reeves2019-11-011-1/+2
| | | | | | | | | | Rather than call just Plugin.setup() and Plugin._do_copy_path(), add an add_copy_spec() call to the mock plugin setup() method, and invoke copying by calling the Plugin.collect() method. Related: #1845 Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [sosreport] grab logs since datePavel Moravec2019-08-251-0/+1
| | | | | | | | | | | | Adds a --since switch that takes a date as an argument. This switch will skip the archive files with a mtime older than the date. Also, --since affects journalctl execution for --all. Resolves: #1678 Signed-off-by: David Vallee Delisle <dvd@redhat.com> Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [SoSPredicate] override kernel module tests if --allow-system-changesBryn M. Reeves2019-08-161-0/+1
| | | | | | | | | | If the --allow-system-changes option is in effect, bypass checking of kernel modules and allow commands to attempt to auto-load any missing modules when run. Related: #1678 Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [sos] Implement sosreport --dry-runBryn M. Reeves2019-03-221-22/+33
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [Plugin] set size limits automaticallyBryn M. Reeves2018-06-201-0/+1
| | | | | | | | | | | If the caller does not specific an explicit size limit (or 0 to disable limits) automatically set the sizelimit argument for the add_copy_spec(), add_cmd_output(), and add_journal() methods to the value of the "log_size" option. Resolves: #1325 Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [Plugin] Make Plugin.policy an object instead of a functionJake Hunsaker2018-04-171-14/+25
| | | | | | | | | | Moves Plugin.policy to be an object for plugins instead of a function, making it easier to leverage the active policy within sos plugins. Resolves: #1179 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [plugins] Dont apply sizelimit if --all-logs option usedPavel Moravec2017-11-011-1/+1
| | | | | | When --all-logs is used, ignore any sizelimits in add_copy_spec. Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [plugins] move the glob tests togetherMichael Adam2017-03-281-4/+4
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] remove duplicate plugin testsMichael Adam2017-03-281-11/+0
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] let all copy_spec tests use add_copy_spec()Michael Adam2017-03-281-9/+9
| | | | | | instead of add_copy_spec_limit() Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] Add tests for add_copy_spec_limit() with multiple copyspecsMichael Adam2017-03-281-0/+8
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] add tests for add_copy_spec_limit()Michael Adam2017-03-281-0/+13
| | | | | | | - a test with a single file without limit - a test with a single glob without limit Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] add test for multiple arguments to add_copy_spec()Michael Adam2017-03-281-0/+4
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] move comment structuring the add_copy_spec_limit testsMichael Adam2017-03-281-2/+2
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] add an extra blank line for separation in plugin_testsMichael Adam2017-03-281-0/+1
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] fix trailing whitespace in plugin_testsMichael Adam2017-03-281-1/+1
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] Make the test_glob_file_over_limit test reliable by using a tmpdirMichael Adam2017-03-281-6/+6
| | | | | | | | Originally,f there were other files matching the glob of /tmp/tmp* then the test would fail. By using a tmpdir, we make sure that we know what files to expect. Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] add optional dir arg to create_file in plugin_testsMichael Adam2017-03-281-2/+2
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] prefix target paths with self.sysrootBryn M. Reeves2015-07-071-19/+38
| | | | | | | | | | Prefix copyspecs with self.sysroot when using an alternate root path. Prefixes are applied before expanding copyspecs and the prefixed paths are stored as the 'srcpath' attribute in the archive. Destination paths in the report archive do not include the prefix. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [global] Fix vim tags typo in all python source filesKamalesh Babulal2015-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the syntax of the vim modeline used to enable the required editing mode in all python sources files. The desired options are: et - expand tabs (convert tab chars to spaces) ts=4 - set tabstop to 4 characters sw=4 - set shiftwidth to 4 characters Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> (edits for commit message, modeline compatibility & options) Signed-off-by: Bryn M. Reeves <bmr@redhat.com> --- __run__.py | 2 +- example_plugins/example.py | 2 +- setup.py | 2 +- sos/archive.py | 2 +- sos/plugins/__init__.py | 2 +- sos/plugins/abrt.py | 2 +- sos/plugins/acpid.py | 2 +- sos/plugins/anaconda.py | 2 +- sos/plugins/anacron.py | 2 +- sos/plugins/apache.py | 2 +- sos/plugins/apparmor.py | 2 +- sos/plugins/apport.py | 2 +- sos/plugins/apt.py | 2 +- sos/plugins/ata.py | 2 +- sos/plugins/auditd.py | 2 +- sos/plugins/autofs.py | 2 +- sos/plugins/azure.py | 2 +- sos/plugins/block.py | 2 +- sos/plugins/boot.py | 2 +- sos/plugins/ceph.py | 2 +- sos/plugins/cgroups.py | 2 +- sos/plugins/cluster.py | 2 +- sos/plugins/cobbler.py | 2 +- sos/plugins/corosync.py | 2 +- sos/plugins/cron.py | 2 +- sos/plugins/cs.py | 2 +- sos/plugins/ctdb.py | 2 +- sos/plugins/cups.py | 2 +- sos/plugins/dbus.py | 2 +- sos/plugins/devicemapper.py | 2 +- sos/plugins/dhcp.py | 2 +- sos/plugins/distupgrade.py | 2 +- sos/plugins/dmraid.py | 2 +- sos/plugins/docker.py | 2 +- sos/plugins/dovecot.py | 2 +- sos/plugins/dpkg.py | 2 +- sos/plugins/ds.py | 2 +- sos/plugins/fcoe.py | 2 +- sos/plugins/filesys.py | 2 +- sos/plugins/firewalld.py | 2 +- sos/plugins/foreman.py | 2 +- sos/plugins/gdm.py | 2 +- sos/plugins/general.py | 2 +- sos/plugins/gluster.py | 2 +- sos/plugins/grub.py | 2 +- sos/plugins/grub2.py | 2 +- sos/plugins/haproxy.py | 2 +- sos/plugins/hardware.py | 2 +- sos/plugins/hpasm.py | 2 +- sos/plugins/hts.py | 2 +- sos/plugins/i18n.py | 2 +- sos/plugins/infiniband.py | 2 +- sos/plugins/ipa.py | 2 +- sos/plugins/ipsec.py | 2 +- sos/plugins/ipvs.py | 2 +- sos/plugins/iscsi.py | 2 +- sos/plugins/iscsitarget.py | 2 +- sos/plugins/java.py | 2 +- sos/plugins/juju.py | 2 +- sos/plugins/kdump.py | 2 +- sos/plugins/keepalived.py | 2 +- sos/plugins/kernel.py | 2 +- sos/plugins/kernelrt.py | 2 +- sos/plugins/keyutils.py | 2 +- sos/plugins/kpatch.py | 2 +- sos/plugins/krb5.py | 2 +- sos/plugins/kvm.py | 2 +- sos/plugins/landscape.py | 2 +- sos/plugins/ldap.py | 2 +- sos/plugins/libraries.py | 2 +- sos/plugins/libvirt.py | 2 +- sos/plugins/lightdm.py | 2 +- sos/plugins/lilo.py | 2 +- sos/plugins/logrotate.py | 2 +- sos/plugins/logs.py | 2 +- sos/plugins/lsbrelease.py | 2 +- sos/plugins/lvm2.py | 2 +- sos/plugins/maas.py | 2 +- sos/plugins/manageiq.py | 2 +- sos/plugins/md.py | 2 +- sos/plugins/megacli.py | 2 +- sos/plugins/memory.py | 2 +- sos/plugins/mongodb.py | 2 +- sos/plugins/mpt.py | 2 +- sos/plugins/mrggrid.py | 2 +- sos/plugins/mrgmessg.py | 2 +- sos/plugins/multipath.py | 2 +- sos/plugins/mysql.py | 2 +- sos/plugins/named.py | 2 +- sos/plugins/navicli.py | 2 +- sos/plugins/networking.py | 2 +- sos/plugins/nfs.py | 2 +- sos/plugins/nfsserver.py | 2 +- sos/plugins/nis.py | 2 +- sos/plugins/nscd.py | 2 +- sos/plugins/ntp.py | 2 +- sos/plugins/numa.py | 2 +- sos/plugins/oddjob.py | 2 +- sos/plugins/openhpi.py | 2 +- sos/plugins/openshift.py | 2 +- sos/plugins/openssl.py | 2 +- sos/plugins/openstack_ceilometer.py | 2 +- sos/plugins/openstack_cinder.py | 2 +- sos/plugins/openstack_glance.py | 2 +- sos/plugins/openstack_heat.py | 2 +- sos/plugins/openstack_horizon.py | 2 +- sos/plugins/openstack_keystone.py | 2 +- sos/plugins/openstack_neutron.py | 2 +- sos/plugins/openstack_nova.py | 2 +- sos/plugins/openstack_swift.py | 2 +- sos/plugins/openstack_trove.py | 2 +- sos/plugins/openswan.py | 2 +- sos/plugins/openvswitch.py | 2 +- sos/plugins/pam.py | 2 +- sos/plugins/pci.py | 2 +- sos/plugins/pcp.py | 2 +- sos/plugins/postfix.py | 2 +- sos/plugins/postgresql.py | 2 +- sos/plugins/powerpath.py | 2 +- sos/plugins/powerpc.py | 2 +- sos/plugins/ppp.py | 2 +- sos/plugins/procenv.py | 2 +- sos/plugins/process.py | 2 +- sos/plugins/processor.py | 2 +- sos/plugins/psacct.py | 2 +- sos/plugins/pxe.py | 2 +- sos/plugins/python.py | 2 +- sos/plugins/qpid.py | 2 +- sos/plugins/quagga.py | 2 +- sos/plugins/rabbitmq.py | 2 +- sos/plugins/radius.py | 2 +- sos/plugins/rhui.py | 2 +- sos/plugins/rpm.py | 2 +- sos/plugins/s390.py | 2 +- sos/plugins/samba.py | 2 +- sos/plugins/sanlock.py | 2 +- sos/plugins/sar.py | 2 +- sos/plugins/satellite.py | 2 +- sos/plugins/scsi.py | 2 +- sos/plugins/selinux.py | 2 +- sos/plugins/sendmail.py | 2 +- sos/plugins/smartcard.py | 2 +- sos/plugins/snmp.py | 2 +- sos/plugins/soundcard.py | 2 +- sos/plugins/squid.py | 2 +- sos/plugins/ssh.py | 2 +- sos/plugins/ssmtp.py | 2 +- sos/plugins/sssd.py | 2 +- sos/plugins/startup.py | 2 +- sos/plugins/sunrpc.py | 2 +- sos/plugins/symcli.py | 2 +- sos/plugins/system.py | 2 +- sos/plugins/systemd.py | 2 +- sos/plugins/systemtap.py | 2 +- sos/plugins/sysvipc.py | 2 +- sos/plugins/targetcli.py | 2 +- sos/plugins/teamd.py | 2 +- sos/plugins/tftpserver.py | 2 +- sos/plugins/tomcat.py | 2 +- sos/plugins/tuned.py | 2 +- sos/plugins/udev.py | 2 +- sos/plugins/unity.py | 2 +- sos/plugins/upstart.py | 2 +- sos/plugins/usb.py | 2 +- sos/plugins/veritas.py | 2 +- sos/plugins/vmware.py | 2 +- sos/plugins/vsftpd.py | 2 +- sos/plugins/x11.py | 2 +- sos/plugins/xen.py | 2 +- sos/plugins/xfs.py | 2 +- sos/plugins/xinetd.py | 2 +- sos/plugins/yum.py | 2 +- sos/policies/__init__.py | 2 +- sos/policies/debian.py | 2 +- sos/policies/osx.py | 2 +- sos/policies/redhat.py | 2 +- sos/policies/ubuntu.py | 2 +- sos/reporting.py | 2 +- sos/sosreport.py | 2 +- sos/utilities.py | 2 +- tests/archive_tests.py | 2 +- tests/importer_tests.py | 2 +- tests/option_tests.py | 2 +- tests/plugin_tests.py | 2 +- tests/policy_tests.py | 2 +- tests/report_tests.py | 2 +- tests/sosreport_pexpect.py | 2 +- tests/test_exe.py | 2 +- tests/utilities_tests.py | 2 +- 189 files changed, 189 insertions(+), 189 deletions(-)
* [archive] remove ZipArchiveBryn M. Reeves2014-12-091-1/+1
| | | | | | | | Remove the ZipArchive class and associated test code. Fixes #322. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [plugin] limit names to PC_NAME_MAXBryn M. Reeves2014-10-201-4/+8
| | | | | | | | | | | | | Commit 8bf7b0c removed the truncation of mangled command names to 64 chars. This causes problems for some plugins (e.g. Issue #415) that generate long enough command lines to hit system name length limits. Instead of arbitrarily limiting to 64 characters limit to the lesser of the archive format limit (if present) or the value of PC_NAME_MAX for any intermediate FileCacheArchive path. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [Plugin] remove add_copy_specs()Bryn M. Reeves2014-09-301-9/+0
| | | | | | | | | | | Merge add_copy_specs() into add_copy_spec() and treat any strings passed to the new method as though they were a single item list. Mirrors the prior change to add_cmd_outputs(). Fixes #301. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [plugins] do not truncate mangled command namesBryn M. Reeves2014-09-161-2/+0
| | | | | | | | | There's no reason to truncate mangled command names within an archive. This isn't MS-DOS 3.1 and there are cases where the 64 character limit causes a loss of uniqueness and resulting name collisions (e.g. namespaced network commands). Fixes #388.
* [plugin] mark more interfaces privateBryn M. Reeves2014-09-121-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Numerous Plugin methods are not expected to be called from outside the base class. Mark them private with a leading underscore: _copy_dir() _copy_node() _copy_symlink() _do_copy_path() _expand_copy_spec() _mangle_command() _make_command_filename() _is_forbidden_path() _collect_copy_specs() _collect_cmd_output() _collect_strings() A couple of these (_mangle_command() and _do_copy_path()) are invoked from the Plugin test suite; update the relevant cases to call the new names. Fixes #348. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Raise a TypeError if add_copy_specs() is called with a stringBryn M. Reeves2014-03-271-0/+3
| | | | | | | | | | Since strings are iterable a plugin attempting to call add_copy_specs("/something") results in a plugin calling add_copy_spec("/"). Raise a TypeError if this happens. Fixes Issue #141. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Add tests for Plugin.add_copy_spec()/add_copy_specs()Bryn M. Reeves2014-03-271-2/+24
| | | | | | Give add_copy_spec() and add_copy_specs() their own test cases. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Update Plugin tests to treat copy_paths as a setBryn M. Reeves2014-03-271-1/+1
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Remove references to 'sub' parameter from plugin testsBryn M. Reeves2014-03-271-7/+3
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Update plugin_tests.py to match new method namesBryn M. Reeves2014-03-271-5/+5
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Add vim tags to all python source filesBryn M. Reeves2014-03-261-0/+2
| | | | | | Fixes Issue #243. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Dead code removal: sos_relative_path()Bryn M. Reeves2014-03-261-16/+1
| | | | | | | The function is defined and even has test cases. But no callers.. Remove the function and the test cases that exercise it. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Remove --profile supportBryn M. Reeves2014-03-251-3/+1
| | | | | | | | | | | | | The handrolled profile logging support in sos hasn't been widely used in a long time and is a problem better solved with external profiling and coverage tools. Rip out all the support and documentation. This shortens and simplifies numerous Plugin class methods. Fixes Issue #244. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Fix plugin_test exception on six.PY2Bryn M. Reeves2014-03-251-2/+2
| | | | | | | Replace explicit test for six.PY2 with try/exception handling of StringIO import. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Python 3 portAdam Stokes2013-10-301-2/+8
| | | | | | | | | | | | This includes a necessary dependency on python-six for its compability layer since we are wanting to continue support for both Python 2.7.x and Python 3.x. In addition, this will allow us to effectively phase out Python 2 support when/if the time arises that all interested distributions have done away with Python 2. This port passes all unittests for both python 2.7.x and python 3.3.x Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>