Skip to content

Replace existing binary rpm in tests with FakePkg #1105

@danigm

Description

@danigm

With the new testing framework it's possible to create FakePkg with metadata and files, so it's possible to replace binary rpm that are used just for testing simple functionality. This way it's possible to remove the number of binary files and it'll be easier to understand what the tests are doing.

Of course we cannot remove all the files inside test/binary/ because it's good test with real rpms, but a lot of tests are using small rpm created just to test a check and the sources of these rpm are not in the repository so it's hard to modify it, so any test that we can update to use FakePkg instead of binary rpm will be an improvement.

  • test_zypp_syntax.py
  • test_xinetd.py
  • test_tmp_files.py
  • test_readelf_parser.py
  • test_python.py
  • test_duplicates.py
  • test_config_files.py

Easy

  • test_sysvinitonsystemd.py
  • test_pam_modules.py
  • test_pkgconfig.py
  • test_menuxdg.py
  • test_mixed_ownership.py (require file permission set)
  • test_LSB.py (require file NAME, VERSION and RELEASE tags)
  • test_FHS.py (just file paths)
  • test_dbus_policy.py
  • test_build_root.py (just file path)
  • test_appdata.py (file path and content)

Medium

  • test_erlang.py (require binary files)
  • test_shlib_policy.py (require binary files)
  • test_logrotate.py (special file content & permissions)
  • test_lib_dependency.py (Just one test needed, Link to .so shouldn't be present in devel package)
  • test_icon_sizes.py (Lots of image binary files, just checks paths and image size)
  • test_files.py (Lots of tests, but easy to replace just replicating rpm files and the content)
  • test_bashisms.py (just file content, it could require some tweaks in the second test, related to pkg.dirname)

Hard

  • test_doc.py (Usage of rpm.ds in the DockCheck.py. files, permissions and requirements. Files with RPMFILE_DOC flag)
  • test_build_date.py (require move read_with_mmap to AbstractPkg)
  • test_tags.py
  • test_alternatives.py (require files, requirements and POSTIN / POSTUN scripts)
  • test_binaries.py (lots of tests, require binary files so we should keep these binary files somewhere, test/files/binaries?)
  • test_zip.py (maybe we can use the python zipfile module to create tests on the fly)
  • test_filter.py (Do not run any check, should be easy to change the binary pkg usage with any of the existing mocks)
  • test_lint.py (Complete package lint, run all tests)
  • test_signature.py (needs some kind of mock for pkg.check_signature. **Maybe it's interesting to keep these rpm filese for this test)
  • test_diff.py (tests for rpmdiff, these are different and maybe require some work on the test code to be able to mock these tests.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions