Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoucheng361 committed May 10, 2024
1 parent e26ba7d commit 12a0b1d
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/scripts/hypo/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ class JuicefsCommandMachine(JuicefsMachine):
MP2 = '/tmp/jfs2'
ROOT_DIR1=os.path.join(MP1, 'fsrand')
ROOT_DIR2=os.path.join(MP2, 'fsrand')
EXCLUDE_RULES = ['rebalance_dir', 'rebalance_file', 'config']
EXCLUDE_RULES = ['rebalance_dir', 'rebalance_file', 'config', 'dump_load_dump', 'dump']
# EXCLUDE_RULES = []
INCLUDE_RULES = ['dump_load_dump', 'mkdir', 'create_file', 'set_xattr']
INCLUDE_RULES = ['dump_load_dump', 'mkdir', 'create_file', 'set_xattr', 'dump']
cmd1 = CommandOperation('cmd1', MP1, ROOT_DIR1)
cmd2 = CommandOperation('cmd2', MP2, ROOT_DIR2)
fsop1 = FsOperation('fs1', ROOT_DIR1)
Expand Down Expand Up @@ -257,7 +257,7 @@ def teardown(self):
settings.register_profile("dev", max_examples=MAX_EXAMPLE, verbosity=Verbosity.debug,
print_blob=True, stateful_step_count=STEP_COUNT, deadline=None, \
report_multiple_bugs=False,
phases=[Phase.reuse, Phase.generate, Phase.target, Phase.shrink, Phase.explain])
phases=[Phase.reuse, Phase.generate, Phase.target, Phase.explain])
profile = os.environ.get('PROFILE', 'dev')
settings.load_profile(profile)

Expand Down
6 changes: 6 additions & 0 deletions .github/scripts/hypo/command_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,11 @@ def test_config(self):
state.config(capacity=1, enable_acl=True, encrypt_secret=True, force=False, inodes=81, trash_days=0, user='root', yes=True)
state.teardown()

def test_dump(self):
state = JuicefsCommandMachine()
v1 = state.init_folders()
state.dump_load_dump(fast=True, folder=v1, keep_secret_key=True, skip_trash=False, threads=10, user='root')
state.teardown()

if __name__ == '__main__':
unittest.main()
2 changes: 1 addition & 1 deletion .github/scripts/hypo/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ def teardown(self):
settings.register_profile("dev", max_examples=MAX_EXAMPLE, verbosity=Verbosity.debug,
print_blob=True, stateful_step_count=STEP_COUNT, deadline=None, \
report_multiple_bugs=False,
phases=[Phase.reuse, Phase.generate, Phase.target, Phase.explain])
phases=[Phase.reuse, Phase.generate, Phase.target, Phase.shrink, Phase.explain])
settings.register_profile("schedule", max_examples=1000, verbosity=Verbosity.debug,
print_blob=True, stateful_step_count=200, deadline=None, \
report_multiple_bugs=False,
Expand Down
8 changes: 8 additions & 0 deletions .github/scripts/hypo/fs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,13 @@ def test_clone_918(self):
v5 = state.clone_cp_file(entry=v3, new_entry_name='mbbb', parent=v1, preserve=True, user='root')
state.teardown()

def test_xattr(self):
state = JuicefsMachine()
v1 = state.init_folders()
v19 = state.create_file(content=b'\xb5y', file_name='wums', mode='x', parent=v1, umask=16, user='root')
v29 = state.set_xattr(file=v19, flag=2, name='R', user='root', value=b'(9')
state.set_xattr(file=v19, flag=2, name='\x8ar', user='root', value=b'E$\xfe')
state.teardown()

if __name__ == '__main__':
unittest.main()
38 changes: 38 additions & 0 deletions .github/scripts/hypo/s3_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,43 @@ def test_issue_4682(self):
state.get_bucket_policy(alias=v1, bucket_name=v6)
state.teardown()

def test_issue_xxx(self):
state = S3Machine()
policies_0, policies_1, policies_2, policies_3 = state.init_policies()
aliases_0 = state.init_aliases()
state.list_groups(alias=aliases_0)
state.set_alias(alias='fxdc', url1='localhost:9000', url2='localhost:9005', user_name='user1')
users_0 = state.add_user(alias=aliases_0, user_name='user2')
state.set_alias(alias='cjxe', url1='localhost:9000', url2='localhost:9005', user_name='user3')
state.list_groups(alias=aliases_0)
buckets_0 = state.create_bucket(alias=aliases_0, bucket_name='zesf')
user_policy_0 = state.set_policy_to_user(alias=aliases_0, policy_name=policies_2, user_name=users_0)
user_policy_1 = state.set_policy_to_user(alias=aliases_0, policy_name=policies_2, user_name=users_0)
state.list_buckets(alias=aliases_0)
state.list_groups(alias=aliases_0)
buckets_1 = state.create_bucket(alias=aliases_0, bucket_name='lzzy')
groups_0 = state.add_group(alias=aliases_0, group_name='group1', members=[users_0])
state.set_alias(alias='zciu', url1='localhost:9000', url2='localhost:9005', user_name='user3')
state.list_buckets(alias=aliases_0)
state.list_buckets(alias=aliases_0)
groups_1 = state.add_group(alias=aliases_0, group_name='group2', members=[users_0])
user_policy_2 = state.set_policy_to_user(alias=aliases_0, policy_name=policies_2, user_name=users_0)
user_policy_3 = state.set_policy_to_user(alias=aliases_0, policy_name=policies_0, user_name=users_0)
groups_2 = state.add_group(alias=aliases_0, group_name='group3', members=[users_0])
state.set_alias(alias='yjjd', url1='localhost:9000', url2='localhost:9005', user_name='user1')
state.list_groups(alias=aliases_0)
state.list_buckets(alias=aliases_0)
aliases_1 = state.set_alias(alias='rbkk', url1='localhost:9000', url2='localhost:9005', user_name=users_0)
user_policy_4 = state.set_policy_to_user(alias=aliases_0, policy_name=policies_3, user_name=users_0)
users_1 = state.add_user(alias=aliases_1, user_name=users_0)
user_policy_5 = state.set_policy_to_user(alias=aliases_0, policy_name=policies_2, user_name=users_0)
users_2 = state.add_user(alias=aliases_1, user_name=users_0)
state.list_buckets(alias=aliases_0)
user_policy_6 = state.set_policy_to_user(alias=aliases_0, policy_name=policies_3, user_name=users_0)
buckets_2 = state.create_bucket(alias=aliases_0, bucket_name='ktvl')
state.create_bucket(alias=aliases_1, bucket_name='wopa')
state.get_bucket_policy(alias=aliases_1, bucket_name=buckets_1)
state.teardown()

if __name__ == '__main__':
unittest.main()

0 comments on commit 12a0b1d

Please sign in to comment.