⚲
Project
Profile
Help
Tour this page
Frequent Planio Questions
Learning Resources
Agiles Projektmanagement einrichten
Sign in
Register
Switch Planio account
Open in Planio App
Share current page
Search
:
Projects
All Projects
Help
Tour this page
Frequent Planio Questions
Learning Resources
Agiles Projektmanagement einrichten
Sign in
Register
Switch Planio account
Open in Planio App
Share current page
Docker Support
Overview
Roadmap
Issues
Gantt
Agile board
Calendar
Repository
Download (1.03 KB)
Story #2993
ยป automate_upload.sh
For QE: A script I used to test the REST API, -
amacdona@redhat.com
, 11/14/2017 06:08 AM
#/bin/bash
# requires: httpie, jq
TEST_NUMBER
=
$1
API_BASE
=
"https://pulp2.dev/pulp/api/v2/"
TEST_MANIFEST_DIR
=
"/home/vagrant/devel/pulp_docker/busybox_manifest_lists/"
function
phttp
(){
http
--verify
no
--cert
~/.pulp/user-cert.pem
$@
}
function
create_upload
(){
phttp
--ignore-stdin
POST
"
$API_BASE
"
content/uploads/ | jq
-r
.upload_id
}
function
upload_bits
(){
phttp
-vvv
PUT
"
$API_BASE
"
content/uploads/
"
$UPLOAD_ID
"
/0/ <
"
$TEST_MANIFEST_DIR
""
$TEST_NUMBER
"
_test_manifest_list.json
}
function
import_upload
(){
phttp POST
"
$API_BASE
"
repositories/busybox/actions/import_upload/
\
upload_id
=
"
$UPLOAD_ID
"
\
unit_type_id
=
"docker_manifest_list"
\
unit_key:
=
'{"digest":"sha256:validateme"}'
}
function
bad_import_upload
(){
phttp POST
"
$API_BASE
"
repositories/busybox/actions/import_upload/
\
upload_id
=
"
$UPLOAD_ID
"
\
unit_type_id
=
"bad_docker_manifest_list"
\
unit_key:
=
'{"digest":"validateme"}'
}
echo
"Creating Upload"
UPLOAD_ID
=
"
$(
create_upload
)
"
echo
"Uploading Bits"
upload_bits
echo
"Import into Repo"
import_upload
(1-1/1)
Loading...