mirror of
https://github.com/clearlinux/cve-check-tool.git
synced 2026-09-06 21:51:33 +00:00
tests: Only run srpm tests in presence of "rpm" binary
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
This commit is contained in:
@@ -78,6 +78,11 @@ START_TEST(cve_rpm_test)
|
||||
package_free(pkg);
|
||||
pkg = NULL;
|
||||
|
||||
if (!g_find_program_in_path("rpm")) {
|
||||
fprintf(stderr, "Unable to perform SRPM tests!");
|
||||
goto rpm;
|
||||
}
|
||||
|
||||
pkg = rpm_inspect_srpm(TOP_DIR "/tests/dummy_data/rpm/", "package", "1.", "5" );
|
||||
fail_if(!pkg, "Failed to inspect source RPM!");
|
||||
fail_if(!srpm_is_patched(pkg, "CVE-2014-5461"), "SRPM patch test failed");
|
||||
@@ -91,6 +96,7 @@ START_TEST(cve_rpm_test)
|
||||
pkg = rpm_inspect_srpm(TOP_DIR "/tests/dummy_data/rpm/", "invalid_package", "1.", "5" );
|
||||
fail_if(pkg, "Incorrectly succeeded at missing source RPM!");
|
||||
|
||||
rpm:
|
||||
pkg = rpm_inspect_spec(TOP_DIR "/tests/dummy_data/rpm/package.spec");
|
||||
fail_if(!pkg, "Failed to inspect RPM spec!");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user