-
Notifications
You must be signed in to change notification settings - Fork 4
test: Backdrop + MySQL 5.7 SSL connectivity #84
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,10 @@ | ||
| name: backdrop-mysql57 | ||
| recipe: backdrop | ||
| config: | ||
| php: '8.4' | ||
| database: mysql | ||
| webroot: web | ||
|
|
||
| # do not remove this | ||
| plugins: | ||
| "@lando/backdrop": ../.. | ||
This file contains hidden or 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,75 @@ | ||
| # Backdrop MySQL Default Version SSL Test | ||
|
|
||
| This example tests that the backdrop recipe with `database: mysql` (no version | ||
| specified, using whatever the default is) correctly handles database client | ||
| connectivity. This matches the real-world scenario where users just set | ||
| `database: mysql` without pinning a version. | ||
|
|
||
| See: https://github.com/lando/lando/issues/3833 | ||
|
|
||
| ## Start up tests | ||
|
|
||
| Run the following commands to get up and running with this example. | ||
|
|
||
| ```bash | ||
| # Should download and extract Backdrop | ||
| lando poweroff | ||
| rm -rf web && mkdir -p web | ||
| curl -fsSL https://github.com/backdrop/backdrop/releases/download/1.33.1/backdrop.zip -o /tmp/backdrop.zip | ||
| unzip -q /tmp/backdrop.zip -d web | ||
| mv web/backdrop/* web/backdrop/.* web/ 2>/dev/null || true | ||
| rmdir web/backdrop 2>/dev/null || true | ||
| ``` | ||
|
|
||
| ```bash | ||
| # Should start up successfully | ||
| lando start | ||
| ``` | ||
|
|
||
| ```bash | ||
| # Should install Backdrop with bee | ||
| cd web && chmod +x core/scripts/* | ||
| lando bee site-install --db-name=backdrop --db-user=backdrop --db-pass=backdrop --db-host=database --username=admin --password=admin --email=test@lando.dev --site-name="MySQL Default Test" --auto | ||
| ``` | ||
|
|
||
| ## Verification commands | ||
|
|
||
| Run the following commands to validate things are rolling as they should. | ||
|
|
||
| ```bash | ||
| # Should auto-detect MySQL and install the MySQL client (not MariaDB) | ||
| lando exec appserver -- mysql --version | grep -qiv "MariaDB" | ||
| ``` | ||
|
|
||
| ```bash | ||
| # Should be able to connect to MySQL 5.7 without SSL errors | ||
| lando mysql backdrop -e "SELECT 1" | ||
| ``` | ||
|
|
||
| ```bash | ||
| # Should be able to run mysql from appserver without SSL errors | ||
| lando exec appserver -- mysql -h database -u backdrop -pbackdrop backdrop -e "SELECT 1" | ||
| ``` | ||
|
|
||
| ```bash | ||
| # Should be able to export with bee without SSL errors | ||
| cd web | ||
| lando bee db-export /tmp/bee-export.sql | ||
| lando exec appserver -- bash -c "zcat /tmp/bee-export.sql.gz | head -5" | grep -i "dump" | ||
| ``` | ||
|
|
||
| ```bash | ||
| # Should be able to export with db-export without SSL errors | ||
| lando db-export --stdout > /tmp/lando-export.sql | ||
| head -5 /tmp/lando-export.sql | grep -i "dump" | ||
| ``` | ||
|
|
||
| ## Destroy tests | ||
|
|
||
| Run the following commands to trash this app like nothing ever happened. | ||
|
|
||
| ```bash | ||
| # Should be destroyed with success | ||
| lando destroy -y | ||
| lando poweroff | ||
| ``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing MySQL 5.7 version pin in database config
High Severity
The
databaseconfig is set tomysqlwithout a version tag, but this test exists specifically to reproduce MySQL 5.7 SSL issues (lando/lando#3833). Other examples in this repo (e.g.backdrop-custom) usedatabase: mysql:5.7to pin the version. Without the:5.7suffix, this will spin up the default MySQL version instead of 5.7, meaning the test won't actually validate the SSL connectivity scenario it was created for.