Skip to content

Commit b9bf49b

Browse files
committed
allow ability to skip single-shot upload test
Signed-off-by: Josh Dolitsky <[email protected]>
1 parent 482a131 commit b9bf49b

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

conformance/02_push_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ var test02Push = func() {
6262

6363
g.Specify("POST request with digest and blob should yield a 201 or 202", func() {
6464
SkipIfDisabled(push)
65+
RunOnlyIfNot(skipSingleShotUploadTest)
6566
req := client.NewRequest(reggie.POST, "/v2/<name>/blobs/uploads/").
6667
SetHeader("Content-Length", configBlobContentLength).
6768
SetHeader("Content-Type", "application/octet-stream").
@@ -80,6 +81,7 @@ var test02Push = func() {
8081

8182
g.Specify("GET request to blob URL from prior request should yield 200 or 404 based on response code", func() {
8283
SkipIfDisabled(push)
84+
RunOnlyIfNot(skipSingleShotUploadTest)
8385
req := client.NewRequest(reggie.GET, "/v2/<name>/blobs/<digest>", reggie.WithDigest(configBlobDigest))
8486
resp, err := client.Do(req)
8587
Expect(err).To(BeNil())

conformance/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,17 @@ and another with no layers. If the empty-layer test is causing a failure, it can
102102
environment:
103103

104104
```
105-
# Enable layer upload
106105
OCI_SKIP_EMPTY_LAYER_PUSH_TEST=1
107106
```
108107

108+
Some registries support pushing blobs with a single POST request; however, this behaviour is not strictly required.
109+
If you wish to disable the single POST test (a.k.a. the "single shot upload"), it can be skipped by setting the
110+
following in the environment:
111+
112+
```
113+
OCI_SKIP_SINGLE_SHOT_UPLOAD_TEST=1
114+
```
115+
109116
The test suite will need access to a second namespace. This namespace is used to check support for cross-repository mounting
110117
of blobs, and may need to be configured on the server-side in advance. It is specified by setting the following in
111118
the environment:

conformance/setup.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ const (
5757
envVarContentDiscovery = "OCI_TEST_CONTENT_DISCOVERY"
5858
envVarContentManagement = "OCI_TEST_CONTENT_MANAGEMENT"
5959
envVarPushEmptyLayer = "OCI_SKIP_EMPTY_LAYER_PUSH_TEST"
60+
envVarSingleShotUpload = "OCI_SKIP_SINGLE_SHOT_UPLOAD_TEST"
6061
envVarBlobDigest = "OCI_BLOB_DIGEST"
6162
envVarManifestDigest = "OCI_MANIFEST_DIGEST"
6263
envVarEmptyLayerManifestDigest = "OCI_EMPTY_LAYER_MANIFEST_DIGEST"
@@ -129,6 +130,7 @@ var (
129130
runContentDiscoverySetup bool
130131
runContentManagementSetup bool
131132
skipEmptyLayerTest bool
133+
skipSingleShotUploadTest bool
132134
deleteManifestBeforeBlobs bool
133135
Version = "unknown"
134136
)
@@ -289,6 +291,7 @@ func init() {
289291
runContentDiscoverySetup = true
290292
runContentManagementSetup = true
291293
skipEmptyLayerTest = false
294+
skipSingleShotUploadTest = false
292295
deleteManifestBeforeBlobs = false
293296

294297
if os.Getenv(envVarTagName) != "" &&
@@ -302,6 +305,7 @@ func init() {
302305
}
303306

304307
skipEmptyLayerTest, _ = strconv.ParseBool(os.Getenv(envVarPushEmptyLayer))
308+
skipSingleShotUploadTest, _ = strconv.ParseBool(os.Getenv(envVarSingleShotUpload))
305309
deleteManifestBeforeBlobs, _ = strconv.ParseBool(os.Getenv(envVarDeleteManifestBeforeBlobs))
306310

307311
reportJUnitFilename = "junit.xml"

0 commit comments

Comments
 (0)