Ejemplo n.º 1
0
 def test_lp_validate_topology(self):
     lp = LinchpinAPI()
     base_path = os.path.realpath(__file__)
     base_path = "/".join(base_path.split("/")[0:-2])
     topo = base_path+"/tests/mockdata/ex_all.yml"
     topo = os.path.abspath(topo)
     lp = lp.lp_validate(topo)
     assert_equal(lp, 0)
Ejemplo n.º 2
0
 def test_lp_validate_topology(self):
     lp = LinchpinAPI()
     base_path = os.path.realpath(__file__)
     base_path = "/".join(base_path.split("/")[0:-2])
     topo = base_path + "/tests/mockdata/ex_all.yml"
     topo = os.path.abspath(topo)
     lp = lp.lp_validate(topo)
     assert_equal(lp, 0)
Ejemplo n.º 3
0
 def test_lp_invgen_with_params(self):
     lp = LinchpinAPI()
     of = im.get_mock_outputfile()
     lf = im.get_mock_layoutfile()
     io = os.getcwd() + "/testoutput.txt"
     lp.lp_invgen(of, lf, io, "generic")
     filegenerated = os.path.exists(io)
     if filegenerated:
         os.remove(io)
     assert_equal(filegenerated, True)
Ejemplo n.º 4
0
 def test_get_config(self):
     lp = LinchpinAPI()
     cfg = lp.get_config()
     keys = [
         'inventory_layouts_path', 'inventory_outputs_path', 'no_output',
         'async_timeout', 'check_mode', 'inventory_playbooks',
         'inventory_types', 'outputfolder_path', 'async', 'keystore_path',
         'inventoryfolder_path', 'schema'
     ]
     assert_equal(cfg.keys(), keys)
Ejemplo n.º 5
0
 def test_lp_invgen_with_params(self):
     lp = LinchpinAPI()
     of = im.get_mock_outputfile()
     lf = im.get_mock_layoutfile()
     io = os.getcwd()+"/testoutput.txt"
     lp.lp_invgen(of, lf, io, "generic")
     filegenerated = os.path.exists(io)
     if filegenerated:
         os.remove(io)
     assert_equal(filegenerated, True)
Ejemplo n.º 6
0
 def test_get_config(self):
     lp = LinchpinAPI()
     cfg = lp.get_config()
     keys = ['inventory_layouts_path',
             'inventory_outputs_path',
             'no_output',
             'async_timeout',
             'check_mode',
             'inventory_playbooks',
             'inventory_types',
             'outputfolder_path',
             'async',
             'keystore_path',
             'inventoryfolder_path',
             'schema']
     assert_equal(cfg.keys(), keys)
Ejemplo n.º 7
0
 def test_get_evars_without_pf(self):
     lp = LinchpinAPI()
     evars = lp.get_evars()
Ejemplo n.º 8
0
 def __init__(self):
     LinchpinAPI.__init__(self)
Ejemplo n.º 9
0
 def test_lp_validate_topology_without_params(self):
     lp = LinchpinAPI()
     lp = lp.lp_validate()
Ejemplo n.º 10
0
 def lp_layout_list(self, upstream=None):
     return LinchpinAPI.lp_layout_list(self, upstream)
Ejemplo n.º 11
0
 def test_lp_topo_get_with_wrong_input_topo(self):
     lp = LinchpinAPI()
     topo = "thisdoesnotexists"
     lp = lp.lp_topo_get(topo)
Ejemplo n.º 12
0
 def test_lp_layout_list_with_wrong_upstream(self):
     lp = LinchpinAPI()
     upstream = "www.example.com"
     lp = lp.lp_alyout_list(upstream)
Ejemplo n.º 13
0
 def test_lp_list_without_params(self):
     lp = LinchpinAPI()
     lp = lp.lp_list()
Ejemplo n.º 14
0
 def test_get_evars_without_pf(self):
     lp = LinchpinAPI()
     evars = lp.get_evars()
Ejemplo n.º 15
0
 def test_get_config_path(self):
     lp = LinchpinAPI()
     config_path = lp.get_config_path().split("/")[-1]
     assert_equal("linchpin_config.yml", config_path)
Ejemplo n.º 16
0
 def test_lp_invgen_without_params(self):
     lp = LinchpinAPI()
     lp = lp.lp_invgen()
Ejemplo n.º 17
0
 def test_get_config_path(self):
     lp = LinchpinAPI()
     config_path = lp.get_config_path().split("/")[-1]
     assert_equal("linchpin_config.yml", config_path)
Ejemplo n.º 18
0
 def test_lp_invgen_without_params(self):
     lp = LinchpinAPI()
     lp = lp.lp_invgen()
Ejemplo n.º 19
0
 def test_lp_topo_get_with_wrong_upstream(self):
     lp = LinchpinAPI()
     topo = "thisdoesnotexists"
     upstream = "www.example.com"
     lp = lp.lp_topo_get(topo, upstream)
Ejemplo n.º 20
0
 def test_lp_validate_topology_without_params(self):
     lp = LinchpinAPI()
     lp = lp.lp_validate()
Ejemplo n.º 21
0
 def test_object_create(self):
     lp = LinchpinAPI()
     assert_equal(isinstance(lp, LinchpinAPI), True)
Ejemplo n.º 22
0
 def test_get_evars(self):
     lp = LinchpinAPI()
     pf = im.get_mock_pf()
     lp.get_evars(pf)
Ejemplo n.º 23
0
 def test_lp_list_without_params(self):
     lp = LinchpinAPI()
     lp = lp.lp_list()
Ejemplo n.º 24
0
 def test_lp_layout_list_without_params(self):
     lp = LinchpinAPI()
     lp = lp.lp_layout_list()
     assert_equal(isinstance(lp, list), True)
Ejemplo n.º 25
0
 def test_get_evars(self):
     lp = LinchpinAPI()
     pf = im.get_mock_pf()
     lp.get_evars(pf)
Ejemplo n.º 26
0
 def test_lp_layout_list_with_wrong_upstream(self):
     lp = LinchpinAPI()
     upstream = "www.example.com"
     lp = lp.lp_alyout_list(upstream)
Ejemplo n.º 27
0
 def test_lp_layout_list_without_params(self):
     lp = LinchpinAPI()
     lp = lp.lp_layout_list()
     assert_equal(isinstance(lp, list), True)
Ejemplo n.º 28
0
 def test_lp_topo_get_without_params(self):
     lp = LinchpinAPI()
     lp = lp.lp_topo_get()
Ejemplo n.º 29
0
 def test_lp_topo_get_without_params(self):
     lp = LinchpinAPI()
     lp = lp.lp_topo_get()
Ejemplo n.º 30
0
 def test_lp_topo_get_with_wrong_input_topo(self):
     lp = LinchpinAPI()
     topo = "thisdoesnotexists"
     lp = lp.lp_topo_get(topo)
Ejemplo n.º 31
0
 def test_lp_topo_get_with_wrong_upstream(self):
     lp = LinchpinAPI()
     topo = "thisdoesnotexists"
     upstream = "www.example.com"
     lp = lp.lp_topo_get(topo, upstream)
Ejemplo n.º 32
0
 def lp_topo_list(self, upstream=None):
     return LinchpinAPI.lp_topo_list(self, upstream)