Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test 2847 #3394

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Introduce extended attributes support in pipe fuse

Test verifies that
- extended attribute calls are supported
- by default only attributes with user prefix are processed, all other attributes are ignored.

**Prerequisites**:
- Admin user

**Preparations**:
1. Create object storage `storage1`
2. In the `storage1` create `file1`

| Steps | Actions | Expected results |
| :---: | --- |--- |
| 1 | Login as the admin user from the prerequisites | |
| 2 | Open the Tools page | |
| 3 | Select `centos` tool | |
| 4 | Launch the tool on on-demand instance | |
| 5 | At the Runs page, click the just-launched run | |
| 6 | Wait until the SSH hyperlink appears | |
| 7 | Click the SSH hyperlink | |
| 8 | In the opened tab, enter and perform the command `yum install attr` | |
| 9 | In the opened tab, enter and perform the command `setfattr -n user.key1 -v value1 cloud-data/storage1/file1` | |
| 10 | In the opened tab, enter and perform the command `setfattr -n user.key2 -v value2 cloud-data/storage1/file1` | |
| 11 | Enter and perform the command `getfattr cloud-data/storage1/file1` | The output contains <br> `file: cloud-data/storage1/file1` <br> `user.key1` <br> `user.key2` |
| 12 | Enter and perform the command `getfattr -n user.key1 cloud-data/storage1/file1` | The output contains <br> `file: cloud-data/storage1/file1` <br> `user.key1="value1"`|
| 13 | Enter and perform the command `setfattr -n another.key1 -v value1 cloud-data/storage1/file1` | The output contains `setfattr: cloud-data/storage1/file1: Operation not supported` |
| 14 | Enter and perform the command `getfattr -n another.key1 cloud-data/storage1/file1` | The output contains <br> `getfattr: cloud-data/storage1/file1: Operation not supported` |

**After:**
- Stop the run launched at step 4
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.epam.pipeline.autotests.utils.C;
import com.epam.pipeline.autotests.utils.TestCase;
import com.epam.pipeline.autotests.utils.Utils;
import static com.epam.pipeline.autotests.utils.Utils.ON_DEMAND;
import com.epam.pipeline.autotests.utils.listener.Cloud;
import com.epam.pipeline.autotests.utils.listener.CloudProviderOnly;
import com.epam.pipeline.autotests.utils.listener.ConditionalTestAnalyzer;
Expand All @@ -41,6 +42,8 @@ public class DataStoragesCLITest extends AbstractSeveralPipelineRunningTest
private final String registry = C.DEFAULT_REGISTRY;
private final String tool = C.TESTING_TOOL_NAME;
private final String group = C.DEFAULT_GROUP;
private final String anotherGroup = C.ANOTHER_GROUP;
private final String testTool = format("%s/%s", anotherGroup, C.TEST_DOCKER_IMAGE);
private final String rootHost = "root@pipeline";
private String storage1 = "dataStorageCLI-" + Utils.randomSuffix();
private String storage2 = "dataStorageCLI-" + Utils.randomSuffix();
Expand All @@ -53,13 +56,15 @@ public class DataStoragesCLITest extends AbstractSeveralPipelineRunningTest
private String fileFor1339_1 = "6-fileFor1339";
private String fileFor1339_2 = "1-fileFor1339";
private String fileFor1339_3 = "7-fileFor1339";
private final String testStorage = format("test-storage-2847-%s", Utils.randomSuffix());
private final String testFile = "testFile";
private String pathStorage3 = "";
private String runID1339 = "";

@AfterClass(alwaysRun = true)
public void removeStorages() {
open(C.ROOT_ADDRESS);
Utils.removeStorages(this, storage1, storage2, storage3);
Utils.removeStorages(this, storage1, storage2, storage3, testStorage);
}

@BeforeMethod
Expand Down Expand Up @@ -201,4 +206,54 @@ public void checkPipeStorageLsPagingOfVersions() {
.assertPageAfterCommandContainsStrings("(latest)")
.close());
}

@Test
@TestCase(value = {"2847"})
public void introduceExtendedAttributesSupportInPipeFuse() {
String[] commands = {
"yum install attr -y",
format("setfattr -n user.key1 -v value1 cloud-data/%s/%s", testStorage, testFile),
format("setfattr -n user.key2 -v value2 cloud-data/%s/%s", testStorage, testFile),
format("getfattr cloud-data/%s/%s", testStorage, testFile),
format("getfattr -n user.key1 cloud-data/%s/%s", testStorage, testFile),
format("setfattr -n another.key1 -v value1 cloud-data/%s/%s", testStorage, testFile),
format("getfattr -n another.key1 cloud-data/%s/%s", testStorage, testFile)
};
library()
.createStorage(testStorage)
.selectStorage(testStorage)
.createFileWithContent(testFile, testFile);
tools()
.perform(registry, anotherGroup, testTool, ToolTab::runWithCustomSettings)
.setPriceType(ON_DEMAND)
.launch(this)
.showLog(getLastRunId())
.waitForSshLink()
.ssh(shell -> {
shell
.waitUntilTextAppears(getLastRunId())
.execute(commands[0])
.assertNextStringIsVisible(commands[0], rootHost)
.execute(commands[1])
.assertNextStringIsVisible(commands[1], rootHost)
.execute(commands[2])
.assertNextStringIsVisible(commands[2], rootHost)
.execute(commands[3])
.assertNextStringIsVisible(commands[3], rootHost)
.assertPageAfterCommandContainsStrings(format("file: cloud-data/%s/%s", testStorage, testFile),
"user.key1", "user.key2")
.execute(commands[4])
.assertNextStringIsVisible(commands[4], rootHost)
.assertPageAfterCommandContainsStrings(format("file: cloud-data/%s/%s", testStorage, testFile),
"user.key1=\"value1\"")
.execute(commands[5])
.assertNextStringIsVisible(commands[5], rootHost)
.assertPageAfterCommandContainsStrings(format("setfattr: cloud-data/%s/%s: Operation not supported",
testStorage, testFile))
.execute(commands[6])
.assertNextStringIsVisible(commands[6], rootHost)
.assertPageAfterCommandContainsStrings(format("getfattr: cloud-data/%s/%s: Operation not supported",
testStorage, testFile));
});
}
}
Loading