def test_option_validation_wrong_combination(self): class Object(object): pass args = Object() # sudo ./bootstrap.py -p yourclusterconfig.yaml -f yournodelist.yaml -a deploy # Target: False args.path = "testpath" args.action = "deploy" args.file = "testfile" self.assertFalse(k8sClusterManagement.option_validation(args)) # sudo ./bootstrap.py -p yourclusterconfig.yaml -f yournodelist.yaml -a clean # Target: False args.path = "testpath" args.action = "clean" args.file = "testfile" self.assertFalse(k8sClusterManagement.option_validation(args)) # sudo ./bootstrap.py -p yourclusterconfig.yaml -f yournodelist.yaml -a install_kubectl # Target: False args.path = "testpath" args.action = "install_kubectl" args.file = "testfile" self.assertFalse(k8sClusterManagement.option_validation(args))
def test_option_validation_missing_option(self): class Object(object): pass args = Object() # sudo ./bootstrap.py -p yourclusterconfig.yaml -a add # Target: False args.path = "testpath" args.action = "add" args.file = None self.assertFalse(k8sClusterManagement.option_validation(args)) # sudo ./bootstrap.py -p yourclusterconfig.yaml -a remove # Target: False args.path = "testpath" args.action = "remove" args.file = None self.assertFalse(k8sClusterManagement.option_validation(args)) # sudo ./bootstrap.py -p yourclusterconfig.yaml -a repair # Target: False args.path = "testpath" args.action = "repair" args.file = None self.assertFalse(k8sClusterManagement.option_validation(args)) # sudo ./bootstrap.py -p yourclusterconfig.yaml -a etcdfix # Target: False args.path = "testpath" args.action = "etcdfix" args.file = None self.assertFalse(k8sClusterManagement.option_validation(args))
def test_option_validation_non_existent_option(self): class Object(object): pass args = Object() # sudo ./bootstrap.py -p yourclusterconfig.yaml -f yournodelist.yaml -a false # Target: False args.path = "testpath" args.action = "false" args.file = "testfile" self.assertFalse(k8sClusterManagement.option_validation(args)) # sudo ./bootstrap.py -p yourclusterconfig.yaml -a false # Target: False args.path = "testpath" args.action = "false" args.file = None self.assertFalse(k8sClusterManagement.option_validation(args))
def test_option_validation_correct_option(self): class Object(object): pass args = Object() # sudo ./bootstrap.py -p yourclusterconfig.yaml -a deploy # Target: True args.path = "testpath" args.action = "deploy" args.file = None self.assertTrue(k8sClusterManagement.option_validation(args)) # sudo ./bootstrap.py -p yourclusterconfig.yaml -a clean # Target: True args.path = "testpath" args.action = "clean" args.file = None self.assertTrue(k8sClusterManagement.option_validation(args)) # sudo ./bootstrap.py -p yourclusterconfig.yaml -a install_kubectl # Target: True args.path = "testpath" args.action = "install_kubectl" args.file = None self.assertTrue(k8sClusterManagement.option_validation(args)) # sudo ./bootstrap.py -p yourclusterconfig.yaml -f yournodelist.yaml -a add # Target: True args.path = "testpath" args.action = "add" args.file = "testfile" self.assertTrue(k8sClusterManagement.option_validation(args)) # sudo ./bootstrap.py -p yourclusterconfig.yaml -f yournodelist.yaml -a remove # Target: True args.path = "testpath" args.action = "remove" args.file = "testfile" self.assertTrue(k8sClusterManagement.option_validation(args)) # sudo ./bootstrap.py -p yourclusterconfig.yaml -f yournodelist.yaml -a repair # Target: True args.path = "testpath" args.action = "repair" args.file = "testfile" self.assertTrue(k8sClusterManagement.option_validation(args)) # sudo ./bootstrap.py -p yourclusterconfig.yaml -f yournodelist.yaml -a etcdfix # Target: True args.path = "testpath" args.action = "etcdfix" args.file = "testfile" self.assertTrue(k8sClusterManagement.option_validation(args))