Skip to content

Commit

Permalink
[backend] ensure that new and legacy rpm-md repos get produced
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschroeter committed Sep 12, 2013
1 parent adc47ce commit bdc87fb
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/api/script/start_test_backend
Expand Up @@ -202,7 +202,7 @@ Package.all.each do |p|
Suse::Backend.put( "/source/#{CGI.escape(p.project.name)}/#{CGI.escape(p.name)}/_meta", p.to_axml)
end
Suse::Backend.put( '/issue_trackers', IssueTracker.all.to_xml(IssueTracker::DEFAULT_RENDER_PARAMS))
Suse::Backend.put( '/source/BaseDistro/_config', "# Empty project config" )
Suse::Backend.put( '/source/BaseDistro/_config', "Repotype: rpm-md-legacy" )
Suse::Backend.put( '/source/BaseDistro/pack1/my_file', "just a file")
Suse::Backend.put( '/source/BaseDistro/pack2/my_file', "different content")
Suse::Backend.put( '/source/BaseDistro/pack2/my_file', "second commit")
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/functional/maintenance_test.rb
Expand Up @@ -1861,7 +1861,7 @@ def test_copy_project_for_release
assert_no_xml_tag :tag => "lock"
get "/source/CopyOfBaseDistro/_config"
assert_response :success
assert_match %r{Empty project config}, @response.body
assert_match %r{Repotype: rpm-md-legacy}, @response.body
get "/source/BaseDistro"
assert_response :success
opackages = ActiveXML::Node.new(@response.body)
Expand Down
25 changes: 25 additions & 0 deletions src/api/test/functional/published_controller_test.rb
Expand Up @@ -62,4 +62,29 @@ def test_binary_view
end
# FIXME: this needs to be extended, when we have added binaries and bs_publisher to the test suite

def test_rpm_md_formats
# OBS is doing this usually right, but createrepo is quite flaky ...
run_scheduler( "i586" )
wait_for_publisher()

login_adrian
# default configured rpm-md
get "/published/home:adrian:ProtectionTest/repo/repodata"
assert_response :success
assert_no_xml_tag :tag => 'entry', :attributes => { :name => "filelists.xml.gz" }
assert_no_xml_tag :tag => 'entry', :attributes => { :name => "other.xml.gz" }
assert_no_xml_tag :tag => 'entry', :attributes => { :name => "primary.xml.gz" }
assert_xml_tag :tag => 'entry', :attributes => { :name => "repomd.xml" }
assert_match /-filelists.xml.gz$/, @response.body
assert_match /-other.xml.gz$/, @response.body
assert_match /-primary.xml.gz$/, @response.body
# legacy configured rpm-md
get "/published/home:Iggy/10.2/repodata"
assert_response :success
assert_xml_tag :tag => 'entry', :attributes => { :name => "filelists.xml.gz" }
assert_xml_tag :tag => 'entry', :attributes => { :name => "other.xml.gz" }
assert_xml_tag :tag => 'entry', :attributes => { :name => "primary.xml.gz" }
assert_xml_tag :tag => 'entry', :attributes => { :name => "repomd.xml" }

end
end
7 changes: 6 additions & 1 deletion src/backend/bs_publish
Expand Up @@ -356,7 +356,12 @@ sub createrepo_rpmmd {
push @createrepoargs, '--changelog-limit', '20';
push @createrepoargs, '--repo', $repotag;
my @legacyargs;
push @legacyargs, '--simple-md-filenames', '--checksum=sha' if $options{'legacy'};
if ($options{'legacy'}) {
push @legacyargs, '--simple-md-filenames', '--checksum=sha';
} else {
# the default in newer createrepos
push @legacyargs, '--unique-md-filenames';
}
my @updateargs;
# createrepo 0.9.9 defaults to usually not used sqlite database.
# We do disable it since it is time and space consuming.
Expand Down

0 comments on commit bdc87fb

Please sign in to comment.