def test_package_no_arch(version_info): """Test the package function with the no_arch option""" vs, info = version_info expect = (info['name'], info['epoch'], info['version'], info['release'], None) pkg = rpm.package(vs, arch_included=False) assert expect == pkg.info
def test_package(version_info): """Test the package function with all version_info""" vs, info = version_info expect = (info['name'], info['epoch'], info['version'], info['release'], info['arch']) pkg = rpm.package(vs) assert expect == pkg.info
def test_package(self): """Test the package function with all version_strings""" for vs, info in version_strings.items(): expect = (info['name'], info['epoch'], info['version'], info['release'], info['arch']) pkg = rpm.package(vs) self.assertEqual(expect, pkg.info)
def create_finaljson(self): ssclub_cmd = "sqlite3 < ssclubdict_command.txt" os.system(ssclub_cmd) df = read_csv('ssclub.csv') rpmparsejson = {} for index, row in df.iterrows(): try: rpmparsejson[str(row["rpm_name"])] = rpm.package(str(row["rpm_name"])).name except: rpmparsejson[str(row["rpm_name"])] = str(row["rpm_name"]) sec = SecuritySheet() libjson = sec.create_libjson() source = SourceSheet() pathjson = source.create_pathjson() finaljson = {} for index, row in df.iterrows(): finaljson[rpmparsejson[str(row["rpm_name"])]] = {"rpm_name": str(row["rpm_name"]), "details": []} for index, row in df.iterrows(): finaljson[rpmparsejson[str(row["rpm_name"])]]["details"].append( {"lib": str(row["Component name"]), "libver": str(row["Component version name"]), "cvelist": libjson[str(row["Component name"])][str(row["Component version name"])], "pathlist": pathjson[str(row["rpm_name"])][str(row["Component name"])][ str(row["Component version name"])]}) return finaljson
def get_rpm_name(rpm_name): return rpm.package(rpm_name).name