From 8ea9aebea2431d1ad5b83e41ae503358b66e133c Mon Sep 17 00:00:00 2001 From: Aaron Elkiss Date: Thu, 30 Oct 2025 16:13:40 -0400 Subject: [PATCH] ETT-780: Bucket root contains obj dir --- lib/HTFeed/Storage/PairtreeObjectStore.pm | 2 +- t/collate.t | 8 ++++---- t/storage_pairtree_object_store.t | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/HTFeed/Storage/PairtreeObjectStore.pm b/lib/HTFeed/Storage/PairtreeObjectStore.pm index 2ca42426..ffac825e 100644 --- a/lib/HTFeed/Storage/PairtreeObjectStore.pm +++ b/lib/HTFeed/Storage/PairtreeObjectStore.pm @@ -12,7 +12,7 @@ sub object_path { my $self = shift; return sprintf( - '%s/%s%s/', + 'obj/%s/%s%s/', $self->{namespace}, id2ppath($self->{objid}), s2ppchars($self->{objid}) diff --git a/t/collate.t b/t/collate.t index a9c94e13..9ad4ed1e 100644 --- a/t/collate.t +++ b/t/collate.t @@ -266,10 +266,10 @@ describe "HTFeed::Collate" => sub { my $s3_timestamp = $s3_backup->[0][0]; - ok($s3s{ptobj1}->s3_has("$pt_path/test.mets.xml")); - ok($s3s{ptobj1}->s3_has("$pt_path/test.zip")); - ok($s3s{ptobj2}->s3_has("$pt_path/test.mets.xml")); - ok($s3s{ptobj2}->s3_has("$pt_path/test.zip")); + ok($s3s{ptobj1}->s3_has("obj/$pt_path/test.mets.xml")); + ok($s3s{ptobj1}->s3_has("obj/$pt_path/test.zip")); + ok($s3s{ptobj2}->s3_has("obj/$pt_path/test.mets.xml")); + ok($s3s{ptobj2}->s3_has("obj/$pt_path/test.zip")); ok($s3s{backup}->s3_has("test.test.$s3_timestamp.zip.gpg")); ok($s3s{backup}->s3_has("test.test.$s3_timestamp.mets.xml")); diff --git a/t/storage_pairtree_object_store.t b/t/storage_pairtree_object_store.t index da344c28..07f3f9d5 100644 --- a/t/storage_pairtree_object_store.t +++ b/t/storage_pairtree_object_store.t @@ -20,8 +20,8 @@ describe "HTFeed::Storage::PairtreeObjectStore" => sub { }; before all => sub { - $bucket_dir = "$vgw_home/$bucket"; - $objdir = "$vgw_home/$bucket-obj"; + $bucket_dir = "$vgw_home/$bucket/obj"; + $objdir = "$vgw_home/$bucket-obj/obj"; make_path($objdir); }; @@ -48,7 +48,7 @@ describe "HTFeed::Storage::PairtreeObjectStore" => sub { it "includes the namespace, pairtree path, and pairtreeized object id" => sub { my $storage = object_storage('test','ark:/123456/abcde'); - is($storage->object_path, "test/pairtree_root/ar/k+/=1/23/45/6=/ab/cd/e/ark+=123456=abcde/"); + is($storage->object_path, "obj/test/pairtree_root/ar/k+/=1/23/45/6=/ab/cd/e/ark+=123456=abcde/"); }; }; @@ -59,8 +59,8 @@ describe "HTFeed::Storage::PairtreeObjectStore" => sub { $storage->move; # should be in the bucket and also visible in the filesystem - ok($s3->s3_has("$pt_path/test.zip")); - ok($s3->s3_has("$pt_path/test.mets.xml")); + ok($s3->s3_has("obj/$pt_path/test.zip")); + ok($s3->s3_has("obj/$pt_path/test.mets.xml")); ok(-s "$bucket_dir/$pt_path/test.zip"); ok(-s "$bucket_dir/$pt_path/test.mets.xml"); };