Project

Profile

Help

Task #4028

Updated by daviddavis about 5 years ago

Prevent the possibility of    duplicate files (ie files with the same relative_path) in a single repo version. I think the places we need to check for dupes are after sync and associate. 

 Steps to reproduce: 

 <pre> 
 http POST http://localhost:24817/pulp/api/v3/repositories/ name=foo 
 export REPO_HREF=$(http :24817/pulp/api/v3/repositories/ | jq -r '.results[] | select(.name == "foo") | ._href') 
 echo "blah1" > 1.iso 
 echo "blah2" > 2.iso 
 export ART1=$(http --form POST http://localhost:24817/pulp/api/v3/artifacts/ file@./1.iso | jq -r '._href') 
 export ART2=$(http --form POST http://localhost:24817/pulp/api/v3/artifacts/ file@./2.iso | jq -r '._href') 
 export CU1=$(http POST http://localhost:24817/pulp/api/v3/content/file/files/ relative_path=1.iso _artifact="$ART1" | jq -r '._href') 
 export CU2=$(http POST http://localhost:24817/pulp/api/v3/content/file/files/ relative_path=1.iso _artifact="$ART2" | jq -r '._href') 
 http POST ':24817'$REPO_HREF'versions/' add_content_units:="[\"$CU1\", \"$CU2\"]" 
 sleep 5 
 http ":24817${REPO_HREF}versions/1/" 
 </pre> 

 You'll see the count is 2 which indicates that there are two 1.iso files in the repository.

Back