-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass in strong password to OSD integ test if version >= 2.12.0 (#4334)
Signed-off-by: Derek Ho <[email protected]>
- Loading branch information
Showing
4 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright OpenSearch Contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# The OpenSearch Contributors require contributions made to | ||
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. | ||
|
||
import semver | ||
|
||
|
||
def get_password(version: str) -> str: | ||
# Starting in 2.12.0, demo configuration setup script requires a strong password | ||
if semver.compare(version, '2.12.0') != -1: | ||
return "myStrongPassword123!" | ||
else: | ||
return "admin" |
16 changes: 16 additions & 0 deletions
16
tests/tests_test_workflow/test_integ_workflow/integ_test/test_utils.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright OpenSearch Contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# The OpenSearch Contributors require contributions made to | ||
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. | ||
|
||
import unittest | ||
|
||
from test_workflow.integ_test.utils import get_password | ||
|
||
|
||
class TestUtils(unittest.TestCase): | ||
def test_strong_password(self) -> None: | ||
self.assertEqual("admin", get_password("2.11.1")) | ||
self.assertEqual("myStrongPassword123!", get_password("3.0.0")) |