Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/kola/ignition: add S3 ARN tests; test intra-cloud anonymous S3/GCS access #1717

Merged
merged 3 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/kola/ignition/resource/authenticated-gs/config.bu
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ ignition:
- source: "gs://ignition-test-fixtures/resources/authenticated-var.ign"
storage:
files:
# Check that anonymous access works with credentials
- path: /var/resource/gs-anon
contents:
source: "gs://ignition-test-fixtures/resources/anonymous"
- path: /var/resource/gs-auth
contents:
source: "gs://ignition-test-fixtures/resources/authenticated"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kola-anonymous
23 changes: 22 additions & 1 deletion tests/kola/ignition/resource/authenticated-s3/config.bu
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,34 @@
# associated with the instance

variant: fcos
version: 1.0.0
version: 1.5.0-experimental
ignition:
config:
merge:
- source: "s3://ignition-test-fixtures/resources/authenticated-var-v3.ign"
storage:
files:
# Check that anonymous access works with credentials
- path: /var/resource/s3-anon
contents:
source: "s3://ignition-test-fixtures/resources/anonymous"
- path: /var/resource/s3-auth
contents:
source: "s3://ignition-test-fixtures/resources/authenticated"
- path: /var/resource/arn-auth
contents:
source: "arn:aws:s3:::ignition-test-fixtures/resources/authenticated"
# Publicly-readable object, fetched via an access point. Access points
# don't allow anonymous access.
- path: /var/resource/arn-ap-anon
contents:
source: "arn:aws:s3:us-east-1:460538899914:accesspoint/ignition-test-fixtures-ap/object/resources/anonymous"
bgilbert marked this conversation as resolved.
Show resolved Hide resolved
- path: /var/resource/arn-ap-auth
contents:
source: "arn:aws:s3:us-east-1:460538899914:accesspoint/ignition-test-fixtures-ap/object/resources/authenticated"
- path: /var/resource/arn-ap-versioned-original
contents:
source: "arn:aws:s3:us-east-1:460538899914:accesspoint/ignition-test-fixtures-ap/object/resources/versioned?versionId=Y9YqVujoLyHHSHJ4DslyXoaLvcilQJnU"
- path: /var/resource/arn-ap-versioned-latest
contents:
source: "arn:aws:s3:us-east-1:460538899914:accesspoint/ignition-test-fixtures-ap/object/resources/versioned"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kola-anonymous
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kola-authenticated
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
updated
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
original
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kola-authenticated
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kola-anonymous
11 changes: 10 additions & 1 deletion tests/kola/ignition/resource/remote/config.bu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variant: fcos
version: 1.2.0
version: 1.5.0-experimental
storage:
files:
- path: /var/resource/http
Expand All @@ -26,3 +26,12 @@ storage:
- path: /var/resource/s3-versioned-https-latest
contents:
source: "https://ignition-test-fixtures.s3.amazonaws.com/resources/versioned"
- path: /var/resource/arn-anon
contents:
source: "arn:aws:s3:::ignition-test-fixtures/resources/anonymous"
- path: /var/resource/arn-versioned-original
contents:
source: "arn:aws:s3:::ignition-test-fixtures/resources/versioned?versionId=Y9YqVujoLyHHSHJ4DslyXoaLvcilQJnU"
- path: /var/resource/arn-versioned-latest
contents:
source: "arn:aws:s3:::ignition-test-fixtures/resources/versioned"
1 change: 1 addition & 0 deletions tests/kola/ignition/resource/remote/data/expected/arn-anon
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kola-anonymous
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
updated
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
original
8 changes: 6 additions & 2 deletions tests/kola/ignition/resource/remote/test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/bash
# kola: { "tags": "needs-internet" }
# kola: { "tags": "needs-internet", "noInstanceCreds": true }
# - tags: needs-internet
# - We fetch resources from S3.
# - We fetch resources from S3 and GCS.
# - noInstanceCreds: don't pass AWS or GCP credentials to instance
# - This test verifies that Ignition can fetch anonymous resources within
# a cloud platform (S3 -> EC2, GCS -> GCE) when no credentials are
# supplied

set -xeuo pipefail

Expand Down