def test_updated(self): days = get_days_since_last_update(SQLMapWrapper.SQLMAP_LOCATION) # See http://nuclearsquid.com/writings/subtree-merging-and-you/ # https://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html # # This requires git >= 1.8 # sudo add-apt-repository ppa:git-core/ppa # sudo apt-get update # sudo apt-get install git # setup_commands = ('git remote add -f' ' sqlmap git://github.com/sqlmapproject/sqlmap.git', 'git subtree add' ' --prefix=w3af/plugins/attack/db/sqlmap/' ' --squash sqlmap master') setup_str = ''.join([' %s\n' % scmd for scmd in setup_commands]) maintain_commands = ('git subtree pull' ' --prefix=w3af/plugins/attack/db/sqlmap/' ' --squash sqlmap master', 'git push') maintain_str = ''.join( [' %s\n' % mcmd for mcmd in maintain_commands]) msg = ('\nYou need to update the sqlmap installation that\'s embedded' ' with w3af. If you run "git remote" and sqlmap appears in the' 'output just run:\n' '%s\n' 'Worse case scenario you will have to setup the remote:\n' '%s') msg = msg % (maintain_str, setup_str) self.assertLess(days, 30, msg)
def test_updated(self): days = get_days_since_last_update(SQLMapWrapper.SQLMAP_LOCATION) # See http://nuclearsquid.com/writings/subtree-merging-and-you/ # https://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html # # This requires git >= 1.8 # sudo add-apt-repository ppa:git-core/ppa # sudo apt-get update # sudo apt-get install git # setup_commands = ( "git remote add -f" " sqlmap git://github.com/sqlmapproject/sqlmap.git", "git subtree add" " --prefix=w3af/plugins/attack/db/sqlmap/" " --squash sqlmap master", ) setup_str = "".join([" %s\n" % scmd for scmd in setup_commands]) maintain_commands = ( "git subtree pull" " --prefix=w3af/plugins/attack/db/sqlmap" " --squash sqlmap master", "git push", ) maintain_str = "".join([" %s\n" % mcmd for mcmd in maintain_commands]) msg = ( "\nYou need to update the sqlmap installation that's embedded" ' with w3af. If you run "git remote" and sqlmap appears in the' "output just run:\n" "%s\n" "Worse case scenario you will have to setup the remote:\n" "%s" ) msg = msg % (maintain_str, setup_str) self.assertLess(days, 30, msg)
def test_get_days_since_last_update_directory(self): dir_name = os.path.join(ROOT_PATH, 'core', 'data', 'misc', 'tests', 'test_dir') dslu = get_days_since_last_update(dir_name) self.assertGreater(dslu, 0)