def test_mapped_distros(initialized_mappings): assert DistroMapping.distros_for("centos", "5", "centos") == [ DistroTuple("rhel", "5", "RHEL") ] assert DistroMapping.distros_for("centos", "6", "centos") == [ DistroTuple("rhel", "6", "RHEL") ]
def test_distro_from(self): print((DistroMapping.distros_for('centos', '7', 'rhel'))) print((DistroMapping.distros_for('centos', '7.4.1', 'rhel'))) print((DistroMapping.distros_for('debian', '9'))) print((DistroMapping.distros_for('ubuntu', '16.04'))) print((DistroMapping.distros_for('busybox', '3'))) print((DistroMapping.distros_for('raspbian', '5'))) print((DistroMapping.distros_for('magaiea', '3'))) print((DistroMapping.distros_for('magaiea', '5', 'fedora,mandriva')))
def test_distro_from(anchore_db): init_distro_mappings() session = get_thread_scoped_session() try: distros = DistroMapping.distros_for('centos', '7', 'rhel') logger.info('Distros for centos 7 (rhel) = {}'.format(distros)) assert distros is not None assert len(distros) == 1 distros = DistroMapping.distros_for('centos', '7.4.1', 'rhel') logger.info('Distros for centos 7.4.1 (rhel) = {}'.format(distros)) assert distros is not None assert len(distros) == 3 distros = DistroMapping.distros_for('debian', '9') logger.info('Distros for debian 9 = {}'.format(distros)) assert distros is not None assert len(distros) == 1 distros = DistroMapping.distros_for('ubuntu', '16.04') logger.info('Distros for ubuntu 16.04 = {}'.format(distros)) assert distros is not None assert len(distros) == 3 distros = DistroMapping.distros_for('busybox', '3') logger.info('Distros for busybox 3 = {}'.format(distros)) assert distros is not None assert len(distros) == 1 distros = DistroMapping.distros_for('raspbian', '5') logger.info('Distros for raspbian 5 = {}'.format(distros)) assert distros is not None assert len(distros) == 1 distros = DistroMapping.distros_for('magaiea', '3') logger.info('Distros for magaiea 3 = {}'.format(distros)) assert distros is not None assert len(distros) == 1 distros = DistroMapping.distros_for('magaiea', '5', 'fedora,mandriva') logger.info( 'Distros for magaiea 5 (fedora, mandriva) = {}'.format(distros)) assert distros is not None assert len(distros) == 1 finally: session.commit()
def test_distro_from(anchore_db): init_distro_mappings() session = get_thread_scoped_session() try: distros = DistroMapping.distros_for("centos", "7", "rhel") logger.info("Distros for centos 7 (rhel) = {}".format(distros)) assert distros is not None assert len(distros) == 1 distros = DistroMapping.distros_for("centos", "7.4.1", "rhel") logger.info("Distros for centos 7.4.1 (rhel) = {}".format(distros)) assert distros is not None assert len(distros) == 3 distros = DistroMapping.distros_for("debian", "9") logger.info("Distros for debian 9 = {}".format(distros)) assert distros is not None assert len(distros) == 1 distros = DistroMapping.distros_for("ubuntu", "16.04") logger.info("Distros for ubuntu 16.04 = {}".format(distros)) assert distros is not None assert len(distros) == 3 distros = DistroMapping.distros_for("busybox", "3") logger.info("Distros for busybox 3 = {}".format(distros)) assert distros is not None assert len(distros) == 1 distros = DistroMapping.distros_for("raspbian", "5") logger.info("Distros for raspbian 5 = {}".format(distros)) assert distros is not None assert len(distros) == 1 distros = DistroMapping.distros_for("magaiea", "3") logger.info("Distros for magaiea 3 = {}".format(distros)) assert distros is not None assert len(distros) == 1 distros = DistroMapping.distros_for("magaiea", "5", "fedora,mandriva") logger.info( "Distros for magaiea 5 (fedora, mandriva) = {}".format(distros)) assert distros is not None assert len(distros) == 1 finally: session.commit()
def test_mapped_distros(initialized_mappings): assert DistroMapping.distros_for( 'centos', '5', 'centos') == [DistroTuple('rhel', '5', 'RHEL')] assert DistroMapping.distros_for( 'centos', '6', 'centos') == [DistroTuple('rhel', '6', 'RHEL')]