Ejemplo n.º 1
0
 def _grep(self, search, platform):
   if not search:
       search = "'OS_PASSWORD': '******'"
   cmd = "egrep -ri \"{0}\" * | cut -d\":\" -f1 > a.tmp".format(search)
   print("[{0}]:{1}".format(platform, cmd))
   os.system(cmd)
   res = Shell.cat("a.tmp")
   if res:
       print ('[{0}]: [ERROR] PASSWORD(OR SECRET KEY) DETECTED, SEE FILES '
              'BELOW'.format(platform))
       print ("")
       print (res)
   else:
       print ("[{0}]: NO PASSWORD DETECTED".format(platform))
   Shell.rm("a.tmp")
   print ("")
Ejemplo n.º 2
0
    def test_15_jobscript(self):
        HEADING()
        db = self.db
        db.connect()

        name = "test1"
        contents = "hallo"

        db.add_script(name, contents)
        db.add_script("test2", "other")
        script = db.get_script(name)

        print("Script:", script)
        print("Content:", contents)

        db.write_script(name, "/tmp/script.txt")
        what = Shell.cat("/tmp/script.txt")

        assert contents == what
        assert contents == script
Ejemplo n.º 3
0
    def test_15_jobscript(self):
        HEADING()
        db = self.db
        db.connect()

        name = "test1"
        contents = "hallo"

        db.add_script(name, contents)
        db.add_script("test2", "other")
        script = db.get_script(name)

        print ("Script:", script)
        print ("Content:", contents)

        db.write_script(name, "/tmp/script.txt")
        what = Shell.cat("/tmp/script.txt")

        assert contents == what
        assert contents == script