Beispiel #1
0
 def test_basicDeactivate(self):
     ticket = Ticket(0, None, None, None)
     pic = PIC("210c-spare", "tel-210c-c3560cx-01:01-Gi1/0/10", "tel-210c-c3560cx-01:01-Gi1/0/10", "Deactivate", None)
     pic.applyCurrentConfig(None, "128.210.148.000/24 Public Subnet (1998)", "100/1000T-SW-A")
     ticket.addPic(pic)
     config = Config.Config(ticket)
     config.run()
Beispiel #2
0
 def test_trunkDeactivate(self):
     ticket = Ticket(0, None, None, None)
     pic = PIC("trunk-test", "tel-210c-c3560cx-01:01-Gi1/0/10", "tel-210c-c3560cx-01:01-Gi1/0/10", "Deactivate", None)
     pic.applyCurrentConfig(None, ["128.210.148.000/24 Public Subnet (2)", "128.210.148.000/24 Public Subnet (3)",
                                   "128.210.148.000/24 Public Subnet (4)"], "100/1000T-SW-A")
     ticket.addPic(pic)
     config = Config.Config(ticket)
     config.run()
Beispiel #3
0
 def test_trunkActivate(self):
     ticket = Ticket(0, None, None, None)
     pic = PIC("trunk-test", "tel-210c-c3560cx-01:01-Gi1/0/10", "tel-210c-c3560cx-01:01-Gi1/0/10", "Activate", None)
     pic.applyNewConfig(None, "128.210.148.000/24 Public Subnet (2)", "10/100/1000T-SW-A")
     pic.addTaggedVlans(["128.210.148.000/24 Public Subnet (3)", "128.210.148.000/24 Public Subnet (5)"])
     ticket.addPic(pic)
     config = Config.Config(ticket)
     config.run()
Beispiel #4
0
 def test_basicModify(self):
     ticket = Ticket(0, None, None, None)
     pic = PIC("210c-SPARE", "tel-210c-c3560cx-01:01-Gi1/0/10", "tel-210c-c3560cx-01:01-Gi1/0/10", "Modify", None)
     pic.applyCurrentConfig(None, "128.210.148.000/24 Public Subnet (1998)", "10/100/1000T-SW-A")
     pic.applyNewConfig(None, "128.210.148.000/24 Public Subnet (1998)", "10/100/1000T-SW-A")
     ticket.addPic(pic)
     config = Config.Config(ticket)
     config.run()
Beispiel #5
0
def main():
    username = raw_input("SSH username: "******"SSH password: "******"Running Activate Test")
    ticket = Ticket(0, None, None, None)
    pic = PIC("test", "pjis-141-c3560cx-01:01-Gi1/0/3",
              "pjis-141-c3560cx-01:01-Gi1/0/3", "Activate", None)
    pic.applyNewConfig(None, "128.210.148.000/24 Public Subnet (877)",
                       "10/100T-SW-A")
    ticket.addPic(pic)
    config = Config.Config(ticket)
    config.run()

    print("Running Modify Test")
    ticket = Ticket(0, None, None, None)
    pic = PIC("test", "pjis-141-c3560cx-01:01-Gi1/0/3",
              "pjis-141-c3560cx-01:01-Gi1/0/3", "Modify", None)
    pic.applyCurrentConfig(None, "128.210.148.000/24 Public Subnet (877)",
                           "10/100T-SW-A")
    pic.applyNewConfig(None, "128.210.148.000/24 Public Subnet (1)",
                       "10/100/1000T-SW-A")
    ticket.addPic(pic)
    config = Config.Config(ticket)
    config.run()

    print("Running Deactivate Test")
    ticket = Ticket(0, None, None, None)
    pic = PIC("test", "pjis-141-c3560cx-01:01-Gi1/0/3",
              "pjis-141-c3560cx-01:01-Gi1/0/3", "Deactivate", None)
    pic.applyCurrentConfig(None, "128.210.148.000/24 Public Subnet (1)",
                           "100/1000T-SW-A")
    ticket.addPic(pic)
    config = Config.Config(ticket)
    config.run()
Beispiel #6
0
 def main(self, ticketNumber=None):
     if not ConfigurationDriver.credentialsStored():
         ConfigurationDriver.lock()
     username, risquePassword, switchPassword = ConfigurationDriver.getCredentials(
     )
     if ticketNumber is None:
         ticketNumber = raw_input("Risque Ticket Number: ")
     ConfigurationDriver.unlock()
     print("Getting Info from Risque")
     if self.risque is None:
         self.risque = Risque(username, risquePassword)
     ticket = self.risque.getTicketData(ticketNumber)
     if ticket is None:
         print("Failed to get ticket from risque")
         if self.appUI is not None:
             self.appUI.goToMainPage()
         return
     self.__printDebugTicket(ticket)
     Config.Config(ticket).run()