Ejemplo n.º 1
0
    def testCompareText2(self):
        option_parser = UmitOptionParser(["--compare-text", "file1.usr", "file2.usr"])
        self.assert_(
            option_parser.get_compare_text() == ("file1.usr", "file2.usr"),
            "Failed to get text compare option \
(--compare-text file1.usr file2.usr)",
        )
Ejemplo n.º 2
0
    def testCompare2(self):
        option_parser = UmitOptionParser(["--compare", "file1.usr", "file2.usr"])
        self.assert_(
            option_parser.get_compare() == ("file1.usr", "file2.usr"),
            "Failed to get compare option \
(--compare file1.usr file2.usr)",
        )
    def testCompareText2(self):
        option_parser = UmitOptionParser(
            ["--compare-text", "file1.usr", "file2.usr"])
        self.assert_(
            option_parser.get_compare_text() == ("file1.usr", "file2.usr"),
            "Failed to get text compare option \
(--compare-text file1.usr file2.usr)")
Ejemplo n.º 4
0
 def testNmap4(self):
     option_parser = UmitOptionParser(["--nmap", "-T4", "-P0", "192.168.0.*"])
     # Shoudl return False, because no nmap arg was defined
     self.assert_(
         option_parser.get_nmap() == ["-T4", "-P0", "192.168.0.*"],
         "Failed to get nmap option (--nmap -T4 -P0 192.168.0.*)",
     )
    def testOpenScanResult4(self):
        option_parser = UmitOptionParser(
            ["--file=file1.xml", "--file=file2.usr", "file3.xml"])
        self.assert_(option_parser.get_open_results() == \
                     ["file1.xml", "file2.usr", "file3.xml"],
                    "Failed to get files (--file=file1.xml \
--file=file2.usr file3.xml)"                            )
Ejemplo n.º 6
0
    def testOpenScanResult4(self):
        option_parser = UmitOptionParser(["--file=file1.xml", "--file=file2.usr", "file3.xml"])
        self.assert_(
            option_parser.get_open_results() == ["file1.xml", "file2.usr", "file3.xml"],
            "Failed to get files (--file=file1.xml \
--file=file2.usr file3.xml)",
        )
Ejemplo n.º 7
0
    def testNSEFacilitator4(self):
        option_parser = UmitOptionParser(["--nse-facilitator", "script1.nse"])
        self.assert_(
            option_parser.get_nse_facilitator() == ["script1.nse"],
            "Failed to get nse-facilitator option \
(--nse-facilitator script1.nse)",
        )
Ejemplo n.º 8
0
    def testDiff2(self):
        option_parser = UmitOptionParser(["--diff", "file1.usr", "file2.usr"])
        self.assert_(
            option_parser.get_diff() == ("file1.usr", "file2.usr"),
            "Failed to get diff option \
(--diff file1.usr file2.usr)",
        )
    def testCompare2(self):
        option_parser = UmitOptionParser(
            ["--compare", "file1.usr", "file2.usr"])
        self.assert_(
            option_parser.get_compare() == ("file1.usr", "file2.usr"),
            "Failed to get compare option \
(--compare file1.usr file2.usr)")
 def testTarget2(self):
     option_parser = UmitOptionParser(["--target=www.microsoft.com"])
     self.assert_(
         option_parser.get_target() == "www.microsoft.com",
         "Failed to get target option (--target=www.microsoft.com)")
 def testOpenScanResult2(self):
     option_parser = UmitOptionParser(
         ["-f", "file1.xml", "-f", "file2.usr"])
     self.assert_(option_parser.get_open_results() == \
                  ["file1.xml", "file2.usr"],
                  "Failed to get files (-f file1.xml -f file2.usr)")
Ejemplo n.º 12
0
 def testInventory2(self):
     option_parser = UmitOptionParser(["--inventory"])
     self.assert_(option_parser.get_inventory(), "Failed to get inventory option (--inventory)")
Ejemplo n.º 13
0
 def testVerbose1(self):
     option_parser = UmitOptionParser([""])
     self.assert_(option_parser.get_verbose() == 40, "Failed to get verbose")
Ejemplo n.º 14
0
 def testNmapProtocol(self):
     option_parser = UmitOptionParser(["nmap://profile_name/target"])
     self.assert_(
         option_parser.get_protocol() == "nmap://profile_name/target",
         "Failed to get protocol argument (nmap://profile_name/target)",
     )
 def testInventory4(self):
     option_parser = UmitOptionParser(["--inventory", "inventory_name"])
     self.assert_(
         option_parser.get_inventory() == "inventory_name",
         "Failed to get inventory option (--inventory inventory_name)")
 def testInventory2(self):
     option_parser = UmitOptionParser(["--inventory"])
     self.assert_(option_parser.get_inventory(),
                  "Failed to get inventory option (--inventory)")
 def testVerbose5(self):
     option_parser = UmitOptionParser(["-v", "-v", "-v", "-v"])
     self.assert_(option_parser.get_verbose() == 0,
                  "Failed to get verbose (-v -v -v -v)")
 def testVerbose1(self):
     option_parser = UmitOptionParser([""])
     self.assert_(option_parser.get_verbose() == 40,
                  "Failed to get verbose")
 def testOpenMapper2(self):
     option_parser = UmitOptionParser(["--mapper=file1.usr"])
     self.assert_(option_parser.get_mapper() == "file1.usr",
                  "Failed to get mapper option (--mapper=file1.usr)")
Ejemplo n.º 20
0
 def testNSEFacilitator3(self):
     option_parser = UmitOptionParser(["--nse-facilitator"])
     self.assert_(
         option_parser.get_nse_facilitator() == ["default"],
         "Failed to get nse-facilitator option (--nse-facilitator)",
     )
 def testNmap3(self):
     option_parser = UmitOptionParser(["--nmap"])
     # Shoudl return False, because no nmap arg was defined
     self.assert_(not option_parser.get_nmap(),
                  "Failed to get nmap option (--nmap)")
Ejemplo n.º 22
0
 def testTarget2(self):
     option_parser = UmitOptionParser(["--target=www.microsoft.com"])
     self.assert_(
         option_parser.get_target() == "www.microsoft.com",
         "Failed to get target option (--target=www.microsoft.com)",
     )
 def testNmap4(self):
     option_parser = UmitOptionParser(
         ["--nmap", "-T4", "-P0", "192.168.0.*"])
     # Shoudl return False, because no nmap arg was defined
     self.assert_(option_parser.get_nmap() == ["-T4", "-P0", "192.168.0.*"],
                  "Failed to get nmap option (--nmap -T4 -P0 192.168.0.*)")
Ejemplo n.º 24
0
 def testOpenScanResult2(self):
     option_parser = UmitOptionParser(["-f", "file1.xml", "-f", "file2.usr"])
     self.assert_(
         option_parser.get_open_results() == ["file1.xml", "file2.usr"],
         "Failed to get files (-f file1.xml -f file2.usr)",
     )
 def testProfile2(self):
     option_parser = UmitOptionParser(["--profile=profile_name"])
     self.assert_(option_parser.get_profile() == "profile_name",
                  "Failed to get profile option (--profile=profile_name)")
Ejemplo n.º 26
0
 def testOpenMapper2(self):
     option_parser = UmitOptionParser(["--mapper=file1.usr"])
     self.assert_(option_parser.get_mapper() == "file1.usr", "Failed to get mapper option (--mapper=file1.usr)")
Ejemplo n.º 27
0
 def testNmap3(self):
     option_parser = UmitOptionParser(["--nmap"])
     # Shoudl return False, because no nmap arg was defined
     self.assert_(not option_parser.get_nmap(), "Failed to get nmap option (--nmap)")
Ejemplo n.º 28
0
 def testVerbose5(self):
     option_parser = UmitOptionParser(["-v", "-v", "-v", "-v"])
     self.assert_(option_parser.get_verbose() == 0, "Failed to get verbose (-v -v -v -v)")
Ejemplo n.º 29
0
 def testProfile2(self):
     option_parser = UmitOptionParser(["--profile=profile_name"])
     self.assert_(
         option_parser.get_profile() == "profile_name", "Failed to get profile option (--profile=profile_name)"
     )
Ejemplo n.º 30
0
 def testInventory4(self):
     option_parser = UmitOptionParser(["--inventory", "inventory_name"])
     self.assert_(
         option_parser.get_inventory() == "inventory_name",
         "Failed to get inventory option (--inventory inventory_name)",
     )
 def testNmapProtocol(self):
     option_parser = UmitOptionParser(["nmap://profile_name/target"])
     self.assert_(option_parser.get_protocol() == \
                  "nmap://profile_name/target",
             "Failed to get protocol argument (nmap://profile_name/target)")
 def testNSEFacilitator3(self):
     option_parser = UmitOptionParser(["--nse-facilitator"])
     self.assert_(
         option_parser.get_nse_facilitator() == ["default"],
         "Failed to get nse-facilitator option (--nse-facilitator)")
Ejemplo n.º 33
0
 def testDiff1(self):
     option_parser = UmitOptionParser(["-d", "file1.usr", "file2.usr"])
     self.assert_(
         option_parser.get_diff() == ("file1.usr", "file2.usr"), "Failed to get diff option (-d file1.usr file2.usr)"
     )
    def testDiff2(self):
        option_parser = UmitOptionParser(["--diff", "file1.usr", "file2.usr"])
        self.assert_(
            option_parser.get_diff() == ("file1.usr", "file2.usr"),
            "Failed to get diff option \
(--diff file1.usr file2.usr)")
    def testNSEFacilitator4(self):
        option_parser = UmitOptionParser(["--nse-facilitator", "script1.nse"])
        self.assert_(
            option_parser.get_nse_facilitator() == ["script1.nse"],
            "Failed to get nse-facilitator option \
(--nse-facilitator script1.nse)")