def test_latest_db_used(self):
        subprocess.check_output('git clone %s' % VULNDB_DATA,
                                shell=True, cwd='/tmp/')
        latest_commit = subprocess.check_output(LATEST_COMMIT,
                                                shell=True, cwd='/tmp/data/')

        shutil.rmtree('/tmp/data/')

        latest_commit = latest_commit.strip()
        latest_saved_commit = DBVuln.get_db_version()

        self.assertEqual(latest_commit, latest_saved_commit)
    def test_latest_db_used(self):
        subprocess.check_output('git clone %s' % VULNDB_DATA,
                                shell=True, cwd='/tmp/')
        latest_commit = subprocess.check_output(LATEST_COMMIT,
                                                shell=True, cwd='/tmp/data/')

        shutil.rmtree('/tmp/data/')

        latest_commit = latest_commit.strip()
        latest_saved_commit = DBVuln.get_db_version()

        self.assertEqual(latest_commit, latest_saved_commit,
                         msg='DB version mismatch, this usually gets fixed'
                             ' by running tools/update-db.sh')
Esempio n. 3
0
    def test_latest_db_used(self):
        subprocess.check_output('git clone %s' % VULNDB_DATA,
                                shell=True,
                                cwd='/tmp/')
        latest_commit = subprocess.check_output(LATEST_COMMIT,
                                                shell=True,
                                                cwd='/tmp/data/')

        shutil.rmtree('/tmp/data/')

        latest_commit = latest_commit.strip()
        latest_saved_commit = DBVuln.get_db_version()

        self.assertEqual(latest_commit, latest_saved_commit)
Esempio n. 4
0
    def test_latest_db_used(self):
        subprocess.check_output('git clone %s' % VULNDB_DATA,
                                shell=True,
                                cwd='/tmp/')
        latest_commit = subprocess.check_output(LATEST_COMMIT,
                                                shell=True,
                                                cwd='/tmp/data/')

        shutil.rmtree('/tmp/data/')

        latest_commit = latest_commit.strip()
        latest_saved_commit = DBVuln.get_db_version()

        self.assertEqual(latest_commit,
                         latest_saved_commit,
                         msg='DB version mismatch, this usually gets fixed'
                         ' by running tools/update-db.sh')