Ejemplo n.º 1
0
def test_config_nodes_absence(empty_config_file):
    with open(empty_config_file, "r") as main_file:
        parser = ConfigurationParser(main_file)
        assert not parser.has_bootstrap_node()
        with pytest.raises(FatalError) as error:
            parser.get_bootstrap_repository()
        assert "repository" in error.value.message
        with pytest.raises(FatalError) as error:
            parser.get_bootstrap_architecture()
        assert "architecture" in error.value.message
Ejemplo n.º 2
0
def test_bootstrap_overlay(config_files):
    with open(config_files, "r") as main_file:
        parser = ConfigurationParser(main_file)
        # the host file shall win
        boostrap_source = SourceEntry(parser.get_bootstrap_repository())
        assert parser.get_bootstrap_architecture() == "i386"
        assert "main" in boostrap_source.comps
        assert boostrap_source.uri == "http://deb.debian.org/debian/"
        # the all file shall provide this key
        expected_key = "https://ftp-master.debian.org/keys/archive-key-8.asc"
        assert parser.get_bootstrap_repository_key() == expected_key
        assert boostrap_source.dist == "jessie"
        assert parser.get_bootstrap_tool() == "debootstrap"
Ejemplo n.º 3
0
def test_config_nodes_presence(config_files):
    with open(config_files, "r") as main_file:
        parser = ConfigurationParser(main_file)
        assert parser.has_bootstrap_node()
        assert parser.get_bootstrap_repository()
        assert parser.get_bootstrap_architecture()