Skip to content

Commit b5df37a

Browse files
opcoder0selldinesh
authored andcommitted
Add support to download docker-ptf.gz (#21107)
What is the motivation for this PR? For PR builds this will later be used to download, load and test docker-ptf from a PR build rather than the master/latest tag. How did you do it? NA How did you verify/test it? Manually Signed-off-by: selldinesh <[email protected]>
1 parent 6bb0a41 commit b5df37a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/scripts/getbuild.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ def download_artifacts(url, content_type, platform, buildid, num_asic, access_to
109109
filename = 'sonic-vs.img.gz'
110110
elif platform == "vpp":
111111
filename = 'sonic-vpp.img.gz'
112+
elif platform == "ptf":
113+
filename = 'docker-ptf.gz'
112114
else:
113115
filename = "sonic-{}.bin".format(platform)
114116

@@ -196,7 +198,7 @@ def main():
196198
parser.add_argument('--branch', metavar='branch',
197199
type=str, help='branch name')
198200
parser.add_argument('--platform', metavar='platform', type=str,
199-
choices=['broadcom', 'mellanox', 'vs', 'vpp'],
201+
choices=['broadcom', 'mellanox', 'vs', 'vpp', 'ptf'],
200202
help='platform to download')
201203
parser.add_argument('--content', metavar='content', type=str,
202204
choices=['all', 'image'], default='image',
@@ -228,7 +230,10 @@ def main():
228230
else:
229231
buildid = int(args.buildid)
230232

231-
artifact_name = "sonic-buildimage.{}".format(args.platform)
233+
if args.platform == 'ptf':
234+
artifact_name = "sonic-buildimage.vs" # PTF images are typically built with VS platform
235+
else:
236+
artifact_name = "sonic-buildimage.{}".format(args.platform)
232237

233238
(dl_url, artifact_size) = get_download_url(buildid, artifact_name,
234239
url_prefix=args.url_prefix,

0 commit comments

Comments
 (0)