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

Update tc 913 #3550

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
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
15 changes: 11 additions & 4 deletions docs/testcases/UI/Run_tools_in_sandbox/Launch_parameters/913.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ Test verifies that for all runs with the file system autoscaling capability bein
**Prerequisites**:
- Admin user

**Preparations**
1. Login as admin user from the prerequisites
2. Open the **Settings** page
3. Click the **PREFERENCES** tab
4. Check that `cluster.instance.hdd.scale.enabled` has enabled value
5. Check that the **`cluster.instance.hdd.scale.delta.ratio`** preference has the value should be specified at deploy (`delta_ratio`)

| Steps | Actions | Expected results |
|:-----:|--------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|:---:|---|---|
| 1 | Login as the admin user from the prerequisites | |
| 2 | Open the **Tools** page | |
| 3 | Select the test tool | |
Expand All @@ -20,11 +27,11 @@ Test verifies that for all runs with the file system autoscaling capability bein
| 11 | Wait until the SSH hyperlink appears | |
| 12 | Click the SSH hyperlink | |
| 13 | In the opened tab, enter and perform the command `df -hT` | File system space usage table is shown in the response |
| 14 | Store ***Avail*** value for filesystem with type `btrfs` | |
| 15 | Enter and perform the command <br> `fallocate -l <file_size>G test.big`, <br> where `<file_size>` is a value equals to the value kept at the step 14 minus 1 |
| 14 | Store ***Avail*** and ***Size*** values for filesystem with type `btrfs` | |
| 15 | Enter and perform the command <br> `fallocate -l <file_size>G test.big`, <br> where `<file_size>` is a value equals to the value of ***Avail*** kept at the step 14 minus 1 |
| 16 | Return to the run log page | |
| 17 | Wait until the ***FilesystemAutoscaling*** task appears | |
| 18 | Click ***FilesystemAutoscaling*** task | Log contains record <br> `Filesystem /ebs was autoscaled <value1>G + <value2>G = <value3>G.`, <br> where <br> `<value1>` is value kept in the step 14, <br> `<value2>` is `<value1> * 0.5`, <br> `<value3> = <value1> + <value2>` |
| 18 | Click ***FilesystemAutoscaling*** task | Log contains record <br> `Filesystem /ebs was autoscaled <value1>G + <value2>G = <value3>G.`, <br> where <br> `<value1>` is value of ***Size*** kept in the step 14, <br> `<value2>` is `<value1> * delta_ratio`, <br> `<value3> = <value1> + <value2>` |
| 19 | Click the SSH hyperlink. In the opened tab, enter and perform the command `df -hT` | File system space usage table is shown in the response that contains ***Size*** value for filesystem with type `btrfs` equal to the `<value3>` from the step 18 |
| 20 | Return to the run log page | |
| 21 | Click **Commit** link. Enter new version. Click **Commit** button | |
Expand Down
1 change: 1 addition & 0 deletions e2e/gui/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,4 @@ e2e.ui.backup.storage.path=
e2e.ui.backup.storage.offset=
e2e.ui.cluster.aws.ebs.type=
e2e.ui.test.run.tag=
e2e.ui.cluster.instance.hdd.scale.delta.ratio=
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.epam.pipeline.autotests.ao.PipelineRunFormAO;
import com.epam.pipeline.autotests.ao.SettingsPageAO;
import com.epam.pipeline.autotests.ao.SettingsPageAO.PreferencesAO;
import com.epam.pipeline.autotests.ao.ShellAO;
import com.epam.pipeline.autotests.ao.ToolTab;
import com.epam.pipeline.autotests.mixins.Authorization;
Expand All @@ -29,6 +30,7 @@
import com.epam.pipeline.autotests.utils.TestCase;
import com.epam.pipeline.autotests.utils.listener.Cloud;
import com.epam.pipeline.autotests.utils.listener.CloudProviderOnly;
import static org.testng.Assert.assertTrue;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Expand Down Expand Up @@ -89,7 +91,9 @@ public class LaunchParametersTest extends AbstractSeveralPipelineRunningTest
private static final String CONSOLE = "Console";
private static final String CLEANUP_ENVIRONMENT_TASK = "CleanupEnvironment";
private static final String FILESYSTEM_AUTOSCALING = "FilesystemAutoscaling";
private static final double SCALING_COEFF = 1.5;
private static final String CLUSTER_INSTANCE_HDD_SCALE_ENABLED = "cluster.instance.hdd.scale.enabled";
private static final String CLUSTER_INSTANCE_HDD_SCALE_DELTA_RATIO = "cluster.instance.hdd.scale.delta.ratio";
private static final double SCALING_COEFF = 1 + Double.parseDouble(C.CLUSTER_INSTANCE_HDD_SCALE_DELTA_RATIO);
private static final String CHECK_SPACE_COMMAND = "df -hT";
private final String pipeline = resourceName(LAUNCH_PARAMETER_RESOURCE);
private final String configuration = resourceName(format("%s-configuration", LAUNCH_PARAMETER_RESOURCE));
Expand Down Expand Up @@ -478,6 +482,7 @@ public void allowToUseR6iInstanceFamilyInSGEhybridAutoscaling() {
@TestCase(value = "913")
@CloudProviderOnly(values = {Cloud.AWS})
public void addSupportForAutoscalingFilesystemForAWS() {
checkHDDpreferences();
tools()
.perform(registry, group, tool, ToolTab::runWithCustomSettings)
.setDisk("25")
Expand Down Expand Up @@ -594,4 +599,20 @@ private void checkFilesystemSpace(ShellAO shell, int diskSize) {
.assertNextStringIsVisible(CHECK_SPACE_COMMAND, rootHost)
.assertPageAfterCommandContainsStrings(CHECK_SPACE_COMMAND, logMessage(diskSize));
}

private void checkHDDpreferences() {
PreferencesAO preferencesAO = navigationMenu()
.settings()
.switchToPreferences();
boolean[] hddScaleEnabled = preferencesAO
.getCheckboxPreferenceState(CLUSTER_INSTANCE_HDD_SCALE_ENABLED);
assertTrue(hddScaleEnabled[0],
format("Preference '%s' isn't enabled", CLUSTER_INSTANCE_HDD_SCALE_ENABLED));

String[] hddScaleDeltaRatio = preferencesAO
.getLinePreference(CLUSTER_INSTANCE_HDD_SCALE_DELTA_RATIO);
assertTrue(hddScaleDeltaRatio[0].equals(C.CLUSTER_INSTANCE_HDD_SCALE_DELTA_RATIO),
format("Preference '%s' has value '%s' instead of '%s'", CLUSTER_INSTANCE_HDD_SCALE_DELTA_RATIO,
hddScaleDeltaRatio[0], C.CLUSTER_INSTANCE_HDD_SCALE_DELTA_RATIO));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public class C {
DEFAULT_CLUSTER_AWS_EBS_TYPE = conf.getProperty("e2e.ui.cluster.aws.ebs.type");
TEST_RUN_TAG = conf.getProperty("e2e.ui.test.run.tag");
DEFAULT_CLOUD_REGION = conf.getProperty("e2e.ui.default.cloud.region");
CLUSTER_INSTANCE_HDD_SCALE_DELTA_RATIO = conf.getProperty("e2e.ui.cluster.instance.hdd.scale.delta.ratio");
}

public static final int DEFAULT_TIMEOUT;
Expand Down Expand Up @@ -233,4 +234,5 @@ public class C {
public static final String BACKUP_STORAGE_PATH;
public static final int BACKUP_STORAGE_OFFSET;
public static final String TEST_RUN_TAG;
public static final String CLUSTER_INSTANCE_HDD_SCALE_DELTA_RATIO;
}
Loading