xlab-uiuc / IDoCT

Illinois Dataset of Configuration Tests
3 stars 23 forks source link

IDOCT: Research Evaluation Task #8

Closed Shubhi-Jain98 closed 2 years ago

Shubhi-Jain98 commented 2 years ago

Hi All, The below CTests include the rewritten tests and the tests validated for correctness and effectiveness.

CTest 1. org.apache.hadoop.net.TestNetUtils#testInvalidAddress

Param1: hadoop.security.dns.log-slow-lookups.threshold.ms

Param2: hadoop.security.dns.log-slow-lookups.enabled

Param3: hadoop.rpc.socket.factory.class.default

CTest 2. org.apache.hadoop.security.TestGroupsCaching# testExceptionCallingLoadWithoutBackgroundRefreshReturnsOldValue

Param1: hadoop.security.groups.cache.background.reload.threads

The CTest passes for bad values 0 and –1 as this configuration is not considered until hadoop.security.groups.cache.background.reload is set to true. On setting this hadoop.security.groups.cache.background.reload to true, the test gives expected behavior.

Param2: hadoop.user.group.static.mapping.overrides

Param3: hadoop.security.groups.negative-cache.secs

Param4: hadoop.security.groups.cache.warn.after.ms

Here, the test is passing on configuration values 0 and –1 because the value, warningDeltaMs, is used as a comparison in the code, if (deltaMs > warningDeltaMs)

Param5: hadoop.security.groups.shell.command.timeout

Below are the two parameters added in the test:

Added Param6: hadoop.security.groups.cache.secs

In this case, conf.setLong was sending default parameter value 1. The test was passing for non-negative values as well. Since time is a positive quantity, the value of the "hadoop.security.groups.cache.secs" parameter should be greater than 0. Hence, removed the default conf.setLong to fix the case.

Added Param7: hadoop.security.groups.cache.background.reload

CTest 3. org.apache.hadoop.io.compress.TestCodec#testGzipCodecWithParam

Param1: io.file.buffer.size

CTest 4. org.apache.hadoop.crypto.key.kms.TestKMSClientProvider#testSelectDelegationToken

Param1: hadoop.security.dns.log-slow-lookups.threshold.ms

Here, the test is passing on configuration value –1 as well because here this value, slowLookupThresholdMs, is used a comparison in the code, if (elapsedMs >= slowLookupThresholdMs)

Param2: hadoop.security.dns.log-slow-lookups.enabled

CTest 5. org.apache.hadoop.security.TestShellBasedUnixGroupsMapping#testFiniteGroupResolutionTime

Param1: hadoop.security.groups.cache.background.reload.threads

Param2: hadoop.security.groups.cache.secs

Param3: hadoop.user.group.static.mapping.overrides

Param4: hadoop.security.groups.cache.background.reload

Param5: hadoop.security.groups.negative-cache.secs

Param6: hadoop.security.groups.cache.warn.after.ms

Here, the test is passing on configuration values 0 and –1 as well because here this value, warningDeltaMs, is used a comparison in the code, if (deltaMs > warningDeltaMs)

tianyin commented 2 years ago

@Justin-Xiang could you help review the PR?

Justin-Xiang commented 2 years ago

Thank you for the PR. Great work!

I have tested all of them and there is only one problem on my side:

In Ctest2 Param2: hadoop.user.group.static.mapping.overrides:

Besides, you can also take a closer look at the cacheGroupsAdd() function.

Btw, I wonder how you test param like "user1=user2=group1" since this param has 2 "=", you may have to modify the run_single_ctest.py to inject this successfully. You can also push changes in this file to this PR.

Shubhi-Jain98 commented 2 years ago

Thank you for reviewing my PR. Pardon me; this is a mistake on my end. I rechecked the workflow, and yes, the test will fail for me=; I have incorporated this change.

For the "user1=user2=user3" value, I found that since the python script finds the index of first "=" so the script injects the whole argument after it as a value; here, "user1=user2=user3". I am attaching the screenshot of the logs.

run_single_test_Logs
tianyin commented 2 years ago

@Justin-Xiang can you review again and try to merge the PR if you think it's correct and ready?

Justin-Xiang commented 2 years ago

@tianyin Yes, I think @Shubhi-Jain98 has corrected the mistake I mentioned so it's ok to merge this PR. But it seems that I don't have the authority to merge PR.

tianyin commented 2 years ago

If you approve, I'm going to merge.

tianyin commented 2 years ago

Thanks @Justin-Xiang for the review and congratulations @Shubhi-Jain98 for getting the PR merged!