コード例 #1
0
 def test_get_iso_sha256(self):
     drp = models.DriverRepoPackage(self.directory)
     iso = drp.get_iso()
     fh = open(iso.get_loc())
     truth_sha256 = utils.checksum_for_file(fh, 'sha256')
     fh.close()
     assert_equal(truth_sha256, iso.get_sha256())
コード例 #2
0
 def test_verify_driver_versions(self):
     drp = models.DriverRepoPackage(self.directory)
     drpms_all, _ = drp.get_rpms()
     driver_rpms = [rpm for rpm in drpms_all if rpm.get_kernel() == 'xen']
     assert len(driver_rpms) == len(self.sample_data['drivers'].keys())
     for driver_rpm in driver_rpms:
         driver_name = driver_rpm.get_name()
         assert driver_name in self.sample_data['drivers'].keys()
         assert_equal(driver_rpm.get_version(), self.sample_data['drivers'][driver_name])
コード例 #3
0
ファイル: json_tests.py プロジェクト: katshann/driverdocs
    def setUp(self):
        self.directory = utils.create_temp_directory("test-directory")

        json_file_loc = "%s/%s" % (os.path.dirname(os.path.realpath(__file__)), self.JSON_FILE)
        fh = open(json_file_loc, 'r')
        json_data = fh.read()
        fh.close()

        utils.create_file(self.directory, "sample-1.0.json", data=json_data)

        self.drp = models.DriverRepoPackage(self.directory)
コード例 #4
0
    def test_verify_rpm_names(self):
        drp = models.DriverRepoPackage(self.directory)
        driver_rpms, userspace_rpms = drp.get_rpms()

        # Define truth list
        rpm_names = [os.path.basename(rpm.split().pop()) for rpm in self.sample_data['rpmdata']]

        for driver_rpm in driver_rpms:
            assert_in(driver_rpm.get_filename(), rpm_names)

        for userspace_rpm in userspace_rpms:
            assert_in(userspace_rpm.get_filename(), rpm_names)

        # Check the total number of rpms is correct
        assert len(driver_rpms) + len(userspace_rpms) == len(rpm_names)
コード例 #5
0
 def test_get_metadata_md5(self):
     drp = models.DriverRepoPackage(self.directory)
     metadata_md5 = drp.get_metadata_file().get_contents()
     assert_equal(self.sample_data['metadata_md5'], metadata_md5)
コード例 #6
0
 def test_get_zip(self):
     drp = models.DriverRepoPackage(self.directory)
     zip_file = drp.get_zip()
     assert_equal(self.sample_data['zip'], zip_file.get_filename())
コード例 #7
0
 def test_get_iso_name(self):
     drp = models.DriverRepoPackage(self.directory)
     iso = drp.get_iso()
     assert_equal(self.sample_data['iso'], iso.get_filename())
コード例 #8
0
 def test_get_kernel_version(self):
     drp = models.DriverRepoPackage(self.directory)
     kernel_ver = drp.get_kernel_version()
     assert_equal(self.sample_data['kernel_version'], kernel_ver)