diff --git a/index-v4.yaml b/index-v4.yaml new file mode 100644 index 00000000000000..868ddee9ed88ed --- /dev/null +++ b/index-v4.yaml @@ -0,0 +1,42 @@ +%YAML 1.1 +# ROS index file +# see REP 153: http://ros.org/reps/rep-0153.html +--- +distributions: + groovy: + distribution: [groovy/distribution.yaml] + distribution_cache: http://repositories.ros.org/rosdistro_cache/groovy-cache.yaml.gz + distribution_status: end-of-life + distribution_type: ros1 + hydro: + distribution: [hydro/distribution.yaml] + distribution_cache: http://repositories.ros.org/rosdistro_cache/hydro-cache.yaml.gz + distribution_status: end-of-life + distribution_type: ros1 + indigo: + distribution: [indigo/distribution.yaml] + distribution_cache: http://repositories.ros.org/rosdistro_cache/indigo-cache.yaml.gz + distribution_status: active + distribution_type: ros1 + jade: + distribution: [jade/distribution.yaml] + distribution_cache: http://repositories.ros.org/rosdistro_cache/jade-cache.yaml.gz + distribution_status: end-of-life + distribution_type: ros1 + kinetic: + distribution: [kinetic/distribution.yaml] + distribution_cache: http://repositories.ros.org/rosdistro_cache/kinetic-cache.yaml.gz + distribution_status: active + distribution_type: ros1 + lunar: + distribution: [lunar/distribution.yaml] + distribution_cache: http://repositories.ros.org/rosdistro_cache/lunar-cache.yaml.gz + distribution_status: active + distribution_type: ros1 + melodic: + distribution: [melodic/distribution.yaml] + distribution_cache: http://repositories.ros.org/rosdistro_cache/melodic-cache.yaml.gz + distribution_status: active + distribution_type: ros1 +type: index +version: 4 diff --git a/test/test_indexes_equal.py b/test/test_indexes_equal.py new file mode 100644 index 00000000000000..dd0e3ed0e83bfe --- /dev/null +++ b/test/test_indexes_equal.py @@ -0,0 +1,35 @@ +import os + +from rosdistro import get_index + +from .fold_block import Fold + +INDEX_V3_YAML = os.path.normpath(os.path.join( + os.path.dirname(os.path.abspath(__file__)), '..', 'index.yaml')) +INDEX_V4_YAML = os.path.normpath(os.path.join( + os.path.dirname(os.path.abspath(__file__)), '..', 'index-v4.yaml')) + + +def test_build_caches(): + with Fold(): + print('Checking that the index.yaml and index-v4.yaml files contain ' + 'the same information expect additional metadata in the v4.') + index_v3 = get_index('file://' + os.path.abspath(INDEX_V3_YAML)) + index_v4 = get_index('file://' + os.path.abspath(INDEX_V4_YAML)) + + dist_names_v3 = list(sorted(index_v3.distributions.keys())) + dist_names_v4 = list(sorted(index_v4.distributions.keys())) + assert dist_names_v3 == dist_names_v4, \ + 'Different set of distribution names' + + for dist_name in dist_names_v3: + dist_v3_data = index_v3.distributions[dist_name] + dist_v4_data = index_v4.distributions[dist_name] + + for key, value in dist_v3_data.items(): + assert key in dist_v4_data, \ + "For distribution '%s' index.yaml contains the key '%s' " \ + "but v4 doesn't contain it" % (dist_name, key) + assert dist_v4_data[key] == value, \ + "For distribution '%s' both yaml files contains the key " \ + "'%s' but with different values" % (dist_name, key)