@@ -19,7 +19,7 @@ const { stat, open } = require('../../util/nb_native')().fs;
19
19
const { get_process_fs_context } = require ( '../../util/native_fs_utils' ) ;
20
20
const { TYPES } = require ( '../../manage_nsfs/manage_nsfs_constants' ) ;
21
21
const ManageCLIError = require ( '../../manage_nsfs/manage_nsfs_cli_errors' ) . ManageCLIError ;
22
- const { TMP_PATH , is_nc_coretest, get_coretest_path, invalid_nsfs_root_permissions,
22
+ const { TMP_PATH , IS_GPFS , is_nc_coretest, get_coretest_path, invalid_nsfs_root_permissions,
23
23
generate_s3_policy, create_fs_user_by_platform, delete_fs_user_by_platform, get_new_buckets_path_by_test_env,
24
24
generate_s3_client, exec_manage_cli, generate_anon_s3_client, generate_nsfs_account } = require ( '../system_tests/test_utils' ) ;
25
25
const nc_mkm = require ( '../../manage_nsfs/nc_master_key_manager' ) . get_instance ( ) ;
@@ -37,7 +37,7 @@ coretest.setup({});
37
37
let CORETEST_ENDPOINT ;
38
38
const inspect = ( x , max_arr = 5 ) => util . inspect ( x , { colors : true , depth : null , maxArrayLength : max_arr } ) ;
39
39
40
- const DEFAULT_FS_CONFIG = get_process_fs_context ( ) ;
40
+ const DEFAULT_FS_CONFIG = get_process_fs_context ( IS_GPFS ? 'GPFS' : '' ) ;
41
41
const new_account_params = {
42
42
has_login : false ,
43
43
s3_access : true ,
@@ -147,6 +147,7 @@ mocha.describe('bucket operations - namespace_fs', function() {
147
147
}
148
148
} ) ;
149
149
mocha . it ( 'export other dir as bucket - and update bucket path to original bucket path' , async function ( ) {
150
+ this . timeout ( 600000 ) ; // eslint-disable-line no-invalid-this
150
151
const obj_nsr = { resource : nsr , path : bucket_path } ;
151
152
const other_obj_nsr = { resource : nsr , path : other_bucket_path } ;
152
153
// give read and write permission to owner
@@ -188,6 +189,7 @@ mocha.describe('bucket operations - namespace_fs', function() {
188
189
} ) ;
189
190
190
191
mocha . it ( 'list buckets without uid, gid' , async function ( ) {
192
+ this . timeout ( 600000 ) ; // eslint-disable-line no-invalid-this
191
193
// Give s3_owner access to the required buckets
192
194
const generated = generate_s3_policy ( EMAIL , first_bucket , [ 's3:*' ] ) ;
193
195
await rpc_client . bucket . put_bucket_policy ( { name : first_bucket , policy : generated . policy } ) ;
@@ -576,11 +578,13 @@ mocha.describe('bucket operations - namespace_fs', function() {
576
578
const s3_xattr = { } ; // invalid xattr won't return on s3 head object
577
579
await tmpfile . replacexattr ( DEFAULT_FS_CONFIG , fs_xattr ) ;
578
580
const xattr_res = ( await tmpfile . stat ( DEFAULT_FS_CONFIG ) ) . xattr ;
581
+ //filter unrelated xattr added by operating system
582
+ const xattr_res_filtered = _ . pickBy ( xattr_res , ( val , name ) => name . startsWith ( "user." ) ) ;
579
583
await tmpfile . close ( DEFAULT_FS_CONFIG ) ;
580
584
581
585
const head_res = await s3_client . headObject ( { Bucket : bucket , Key : key } ) ;
582
586
assert . deepStrictEqual ( head_res . Metadata , s3_xattr ) ;
583
- assert . deepStrictEqual ( fs_xattr , xattr_res ) ;
587
+ assert . deepStrictEqual ( fs_xattr , xattr_res_filtered ) ;
584
588
const get_res = await s3_client . getObject ( { Bucket : bucket , Key : key } ) ;
585
589
assert . deepStrictEqual ( get_res . Metadata , s3_xattr ) ;
586
590
await s3_client . deleteObject ( { Bucket : bucket , Key : key } ) ;
@@ -599,11 +603,13 @@ mocha.describe('bucket operations - namespace_fs', function() {
599
603
const s3_xattr = { 'key1.2.3' : encoded_xattr } ;
600
604
await tmpfile . replacexattr ( DEFAULT_FS_CONFIG , fs_xattr ) ;
601
605
const xattr_res = ( await tmpfile . stat ( DEFAULT_FS_CONFIG ) ) . xattr ;
606
+ //filter unrelated xattr added by operating system
607
+ const xattr_res_filtered = _ . pickBy ( xattr_res , ( val , name ) => name . startsWith ( "user." ) ) ;
602
608
await tmpfile . close ( DEFAULT_FS_CONFIG ) ;
603
609
604
610
const head_res = await s3_client . headObject ( { Bucket : bucket , Key : key } ) ;
605
611
assert . deepStrictEqual ( head_res . Metadata , s3_xattr ) ;
606
- assert . deepStrictEqual ( fs_xattr , xattr_res ) ;
612
+ assert . deepStrictEqual ( fs_xattr , xattr_res_filtered ) ;
607
613
const get_res = await s3_client . getObject ( { Bucket : bucket , Key : key } ) ;
608
614
assert . deepStrictEqual ( get_res . Metadata , s3_xattr ) ;
609
615
await s3_client . deleteObject ( { Bucket : bucket , Key : key } ) ;
@@ -818,6 +824,7 @@ mocha.describe('bucket operations - namespace_fs', function() {
818
824
} ) ;
819
825
820
826
mocha . it ( 'delete bucket with uid, gid - bucket is empty' , async function ( ) {
827
+ this . timeout ( 600000 ) ; // eslint-disable-line no-invalid-this
821
828
const res = await s3_correct_uid_default_nsr . deleteBucket ( { Bucket : bucket_name + '-s3' } ) ;
822
829
console . log ( inspect ( res ) ) ;
823
830
} ) ;
@@ -924,6 +931,7 @@ mocha.describe('bucket operations - namespace_fs', function() {
924
931
}
925
932
} ) ;
926
933
mocha . it ( 'delete bucket with uid, gid - bucket is empty' , async function ( ) {
934
+ this . timeout ( 600000 ) ; // eslint-disable-line no-invalid-this
927
935
// Give s3_correct_uid_default_nsr access to the required buckets
928
936
await Promise . all (
929
937
[ bucket_name + '-other1' , bucket_name ]
@@ -1148,6 +1156,7 @@ mocha.describe('nsfs account configurations', function() {
1148
1156
await fs_utils . folder_delete ( tmp_fs_root1 ) ;
1149
1157
} ) ;
1150
1158
mocha . it ( 'export dir as a bucket' , async function ( ) {
1159
+ this . timeout ( 600000 ) ; // eslint-disable-line no-invalid-this
1151
1160
await rpc_client . pool . create_namespace_resource ( {
1152
1161
name : nsr1 ,
1153
1162
nsfs_config : {
@@ -1628,6 +1637,7 @@ mocha.describe('list buckets - namespace_fs', async function() {
1628
1637
} ) ;
1629
1638
1630
1639
mocha . it ( 'account1 - all accounts are allowed to list bucket1' , async function ( ) {
1640
+ this . timeout ( 50000 ) ; // eslint-disable-line no-invalid-this
1631
1641
// allow all accounts to list bucket1
1632
1642
const public_bucket = accounts . account1 . bucket ;
1633
1643
const bucket_policy = generate_s3_policy ( '*' , public_bucket , [ 's3:ListBucket' ] ) ;
@@ -1666,6 +1676,7 @@ mocha.describe('list buckets - namespace_fs', async function() {
1666
1676
} ) ;
1667
1677
1668
1678
mocha . it ( 'account2 - set allow only account1 list bucket2, account1/account2 can list bucket2 but account3 cant' , async function ( ) {
1679
+ this . timeout ( 50000 ) ; // eslint-disable-line no-invalid-this
1669
1680
const bucket2 = accounts . account2 . bucket ;
1670
1681
const account_name = 'account1' ;
1671
1682
// on NC the account identifier is account name, and on containerized it's the account's email
0 commit comments