Exemple #1
0
 def test_install_conf(self):
     """测试install_conf的调用"""
     tmpdir = initconf.create_destdir()
     chrootdir = os.path.realpath(self._create_dir("namedchroot"))
     real_confdir = os.path.join(chrootdir, "etc/namedconf")
     self.assertTrue(initconf.create_conf(tmpdir))
     self.assertTrue(initconf.install_conf(tmpdir, chrootdir))
 def test_install_conf(self):
     """测试install_conf的调用"""
     tmpdir = initconf.create_destdir()
     chrootdir = os.path.realpath(self._create_dir("namedchroot"))
     real_confdir = os.path.join(chrootdir, "etc/namedconf")
     self.assertTrue( initconf.create_conf(tmpdir) )
     self.assertTrue(initconf.install_conf(tmpdir, chrootdir) )
Exemple #3
0
 def test_check_conf(self):
     '''使用named-checkconf检查生成文件语法'''
     tmpdir = initconf.create_destdir()
     self.assertTrue(initconf.create_conf(tmpdir))
     ret = shtools.execute(executable="named-checkconf",
                           args="-t %s /%s/named.conf" %
                           (tmpdir, sysconf.namedconf),
                           output="/tmp/hd.txt")
     self.assertEqual(ret, 0)
Exemple #4
0
 def test_create_conf(self):
     """测试create_conf的调用"""
     tmpdir = initconf.create_destdir()
     self.assertTrue(initconf.create_conf(tmpdir))
     shutil.rmtree(tmpdir)
 def test_check_conf(self):
     '''使用named-checkconf检查生成文件语法'''
     tmpdir = initconf.create_destdir()
     self.assertTrue(initconf.create_conf(tmpdir))
     ret = shtools.execute(executable = "named-checkconf", args = "-t %s /%s/named.conf"%(tmpdir, sysconf.namedconf), output="/tmp/hd.txt")
     self.assertEqual(ret, 0)
 def test_create_conf(self):
     """测试create_conf的调用"""
     tmpdir = initconf.create_destdir()
     self.assertTrue( initconf.create_conf(tmpdir) )
     shutil.rmtree(tmpdir)