Ejemplo n.º 1
0
 def test_backup_conf(self):
     """测试backup_conf的调用"""
     tmpdir = self._create_dir("backuptest")
     self.assertTrue( initconf.backup_conf("/etc",tmpdir) )
     conffilename = "namedconf_%s.tar.gz"%(time.strftime("%y%m%d%H%M"))
     log.debug("backup file is:%s"%(os.path.join(tmpdir,conffilename)))
     self.assertTrue( os.path.isfile(os.path.join(tmpdir,conffilename)) )
Ejemplo n.º 2
0
 def test_backup_conf(self):
     """测试backup_conf的调用"""
     tmpdir = self._create_dir("backuptest")
     self.assertTrue(initconf.backup_conf("/etc", tmpdir))
     conffilename = "namedconf_%s.tar.gz" % (time.strftime("%y%m%d%H%M"))
     log.debug("backup file is:%s" % (os.path.join(tmpdir, conffilename)))
     self.assertTrue(os.path.isfile(os.path.join(tmpdir, conffilename)))
Ejemplo n.º 3
0
 def test_error_backup_conf(self):
     """对于backup_conf的错误调用测试"""
     self.assertFalse(initconf.backup_conf("中华人民共和国", "中华人民共和国"))
Ejemplo n.º 4
0
 def test_error_backup_conf(self):
     """对于backup_conf的错误调用测试"""
     self.assertFalse( initconf.backup_conf("中华人民共和国","中华人民共和国") )