Skip to content

Commit

Permalink
Merge pull request openzfs#485 from delphix/projects/merge-upstream/m…
Browse files Browse the repository at this point in the history
…aster

Merge remote-tracking branch '6.0/stage' into 'master'
  • Loading branch information
grwilson authored Jun 23, 2022
2 parents b528ca3 + 185d0fe commit 3553b3d
Show file tree
Hide file tree
Showing 34 changed files with 728 additions and 521 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/zfs-tests-dlpx-functional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
shell: bash
timeout-minutes: 330
- name: Prepare artifacts
if: failure()
if: failure() || cancelled()
run: |
RESULTS_PATH=$(readlink -f /var/tmp/test_results/current)
sudo dmesg > $RESULTS_PATH/dmesg
Expand All @@ -73,7 +73,7 @@ jobs:
# Replace ':' in dir names, actions/upload-artifact doesn't support it
for f in $(find /var/tmp/test_results -name '*:*'); do mv "$f" "${f//:/__}"; done
- uses: actions/upload-artifact@v2
if: failure()
if: failure() || cancelled()
with:
name: Test logs Ubuntu-${{ matrix.os }}
path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/zfs-tests-functional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
shell: bash
timeout-minutes: 330
- name: Prepare artifacts
if: failure()
if: failure() || cancelled()
run: |
RESULTS_PATH=$(readlink -f /var/tmp/test_results/current)
sudo dmesg > $RESULTS_PATH/dmesg
Expand All @@ -73,7 +73,7 @@ jobs:
# Replace ':' in dir names, actions/upload-artifact doesn't support it
for f in $(find /var/tmp/test_results -name '*:*'); do mv "$f" "${f//:/__}"; done
- uses: actions/upload-artifact@v2
if: failure()
if: failure() || cancelled()
with:
name: Test logs Ubuntu-${{ matrix.os }}
path: |
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/zfs-tests-object-store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,31 @@ jobs:
sudo cp -r $HOME/.aws /root
- name: Tests
run: |
# The github CI package build doesn't enable any ZFS services by
# default. Since the object agent service is available on the test VM,
# ZTS tries to use it. Since it depends on the zfs-mount service, we
# enable it here. If we don't the agent will fail to start, and the
# workflow will hang.
sudo systemctl enable --now zfs-mount
/usr/share/zfs/zfs-tests.sh -v -s 3G -r object_store
env:
LD_LIBRARY_PATH: /lib/x86_64-linux-gnu
ZTS_OBJECT_STORE: true
ZTS_OBJECT_STORE: s3
ZTS_BUCKET_NAME: testbucket
ZTS_OBJECT_ENDPOINT: http://127.0.0.1:9000
ZTS_REGION: us-west-2
AWS_ACCESS_KEY_ID: minioadmin
AWS_SECRET_ACCESS_KEY: minioadmin
AWS_EC2_METADATA_DISABLED: true
- name: Prepare artifacts
if: failure()
if: failure() || cancelled()
run: |
RESULTS_PATH=$(readlink -f /var/tmp/test_results/current)
sudo dmesg > $RESULTS_PATH/dmesg
sudo cp /var/log/syslog $RESULTS_PATH/
# Stop the zfs-object-agent to prevent it from writing
# into the /var/log/zoa
sudo systemctl stop zfs-object-agent.service
sudo systemctl stop zfs-object-agent.service || true
# The create archive command may exit with status 1 if the
# files are being updated while the tar command is running
# Thus we do a clean exit in such case for the next
Expand All @@ -90,7 +96,7 @@ jobs:
# Replace ':' in dir names, actions/upload-artifact doesn't support it
for f in $(find $RESULTS_PATH -name '*:*'); do mv "$f" "${f//:/__}"; done
- uses: actions/upload-artifact@v2
if: failure()
if: failure() || cancelled()
with:
name: Test logs
path: /var/tmp/test_results/20*/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/zfs-tests-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
shell: bash
timeout-minutes: 330
- name: Prepare artifacts
if: failure()
if: failure() || cancelled()
run: |
RESULTS_PATH=$(readlink -f /var/tmp/test_results/current)
sudo dmesg > $RESULTS_PATH/dmesg
Expand All @@ -69,7 +69,7 @@ jobs:
# Replace ':' in dir names, actions/upload-artifact doesn't support it
for f in $(find /var/tmp/test_results -name '*:*'); do mv "$f" "${f//:/__}"; done
- uses: actions/upload-artifact@v2
if: failure()
if: failure() || cancelled()
with:
name: Test logs Ubuntu-${{ matrix.os }}
path: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/zloop-object-store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,26 @@ jobs:
sudo -E /usr/share/zfs/zloop.sh -t 1200 -l -m1 -- -T 120 -P 60
env:
LD_LIBRARY_PATH: /lib/x86_64-linux-gnu
ZTS_OBJECT_STORE: true
ZTS_OBJECT_STORE: s3
ZTS_BUCKET_NAME: testbucket
ZTS_OBJECT_ENDPOINT: http://127.0.0.1:9000
ZTS_REGION: us-west-2
AWS_ACCESS_KEY_ID: minioadmin
AWS_SECRET_ACCESS_KEY: minioadmin
- name: Prepare artifacts
if: failure()
if: failure() || cancelled()
run: |
sudo chmod +r -R $TEST_DIR/
- uses: actions/upload-artifact@v2
if: failure()
if: failure() || cancelled()
with:
name: Logs
path: |
/var/tmp/zloop/*/
!/var/tmp/zloop/*/vdev/
if-no-files-found: ignore
- uses: actions/upload-artifact@v2
if: failure()
if: failure() || cancelled()
with:
name: Pool files
path: |
Expand Down
40 changes: 23 additions & 17 deletions cmd/zdb/zdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -8531,32 +8531,38 @@ zdb_embedded_block(char *thing)
static nvlist_t *
make_objectstore_prop(void)
{
if (endpoint == NULL) {
(void) fprintf(stderr,
"object-store endpoint not specified.\n");
usage();
}
if (region == NULL) {
(void) fprintf(stderr,
"object-store region not specified.\n");
usage();
// We default to s3 for compatibility's sake
if (protocol == NULL)
protocol = "s3";

if (strcmp(protocol, "s3") == 0) {
if (endpoint == NULL) {
(void) fprintf(stderr,
"object-store endpoint not specified.\n");
usage();
}
if (region == NULL) {
(void) fprintf(stderr,
"object-store region not specified.\n");
usage();
}
}
if (bucket == NULL) {
(void) fprintf(stderr,
"object-store bucket not specified.\n");
usage();
}

// We default to s3 for compatibility's sake
if (protocol == NULL)
protocol = "s3";

nvlist_t *nv = fnvlist_alloc();
fnvlist_add_string(nv, ZPOOL_CONFIG_PATH, bucket);
fnvlist_add_string(nv, zpool_prop_to_name(ZPOOL_PROP_OBJ_ENDPOINT),
endpoint);
fnvlist_add_string(nv, zpool_prop_to_name(ZPOOL_PROP_OBJ_REGION),
region);
if (endpoint != NULL) {
fnvlist_add_string(nv,
zpool_prop_to_name(ZPOOL_PROP_OBJ_ENDPOINT), endpoint);
}
if (region != NULL) {
fnvlist_add_string(nv,
zpool_prop_to_name(ZPOOL_PROP_OBJ_REGION), region);
}
fnvlist_add_string(nv, zpool_prop_to_name(ZPOOL_PROP_OBJ_CRED_PROFILE),
creds_profile);
fnvlist_add_string(nv, zpool_prop_to_name(ZPOOL_PROP_OBJ_PROTOCOL),
Expand Down
Loading

0 comments on commit 3553b3d

Please sign in to comment.