wintest Add automatic dcpromo is the host isn't a DC yet
[sfrench/samba-autobuild/.git] / wintest / wintest.py
index 201ed089e2aa0f635f0cfbf93092174267a377ed..e295c52f9fc0eaba6c2ded732aebbaaf14dbd538 100644 (file)
@@ -332,6 +332,16 @@ class wintest():
         self.setvar('WIN_DEFAULT_GATEWAY', child.after)
         child.expect("C:")
 
+    def get_is_dc(self, child):
+        child.sendline("dcdiag")
+        i = child.expect(["is not a Directory Server", "Home Server = "])
+        if i == 0:
+            return False
+        child.expect('[\S]+')
+        hostname = child.after
+        if hostname.upper() == self.getvar("WIN_HOSTNAME").upper:
+            return True
+
     def run_tlntadmn(self, child):
         '''remove the annoying telnet restrictions'''
         child.sendline('tlntadmn config maxconn=1024')