Exemplo n.º 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))
Exemplo n.º 2
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) )
Exemplo n.º 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)
Exemplo n.º 4
0
 def test_create_conf(self):
     """测试create_conf的调用"""
     tmpdir = initconf.create_destdir()
     self.assertTrue(initconf.create_conf(tmpdir))
     shutil.rmtree(tmpdir)
Exemplo n.º 5
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)
Exemplo n.º 6
0
 def test_create_conf(self):
     """测试create_conf的调用"""
     tmpdir = initconf.create_destdir()
     self.assertTrue( initconf.create_conf(tmpdir) )
     shutil.rmtree(tmpdir)