2022-05-02 10:46:10 +02:00
|
|
|
Describe "MongoDB" -Skip:(Test-IsUbuntu22) {
|
2020-12-30 18:04:55 +03:00
|
|
|
It "<ToolName>" -TestCases @(
|
|
|
|
|
@{ ToolName = "mongo" }
|
|
|
|
|
@{ ToolName = "mongod" }
|
|
|
|
|
) {
|
2021-11-10 19:30:25 +03:00
|
|
|
$toolsetVersion = (Get-ToolsetContent).mongodb.version
|
|
|
|
|
(&$ToolName --version)[2].Split('"')[-2] | Should -BeLike "$toolsetVersion*"
|
2020-12-30 18:04:55 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Describe "PostgreSQL" {
|
|
|
|
|
It "PostgreSQL Service" {
|
|
|
|
|
"sudo systemctl start postgresql" | Should -ReturnZeroExitCode
|
2021-12-28 11:16:20 +03:00
|
|
|
"pg_isready" | Should -MatchCommandOutput "/var/run/postgresql:5432 - accepting connections"
|
2021-12-14 21:46:30 +03:00
|
|
|
"sudo systemctl stop postgresql" | Should -ReturnZeroExitCode
|
2020-12-30 18:04:55 +03:00
|
|
|
}
|
2021-11-16 11:48:38 +03:00
|
|
|
|
|
|
|
|
It "PostgreSQL version should correspond to the version in the toolset" {
|
|
|
|
|
$toolsetVersion = (Get-ToolsetContent).postgresql.version
|
|
|
|
|
# Client version
|
|
|
|
|
(psql --version).split()[-1] | Should -BeLike "$toolsetVersion*"
|
|
|
|
|
# Server version
|
|
|
|
|
(pg_config --version).split()[-1] | Should -BeLike "$toolsetVersion*"
|
|
|
|
|
}
|
2020-12-30 18:04:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Describe "MySQL" {
|
|
|
|
|
It "MySQL CLI" {
|
|
|
|
|
"mysql -V" | Should -ReturnZeroExitCode
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
It "MySQL Service" {
|
2021-01-08 16:02:09 +03:00
|
|
|
"sudo systemctl start mysql" | Should -ReturnZeroExitCode
|
2021-12-08 16:02:06 +03:00
|
|
|
mysql -s -N -h localhost -uroot -proot -e "select count(*) from mysql.user where user='root' and authentication_string is null;" | Should -BeExactly 0
|
2020-12-30 18:04:55 +03:00
|
|
|
"sudo mysql -vvv -e 'CREATE DATABASE smoke_test' -uroot -proot" | Should -ReturnZeroExitCode
|
|
|
|
|
"sudo mysql -vvv -e 'DROP DATABASE smoke_test' -uroot -proot" | Should -ReturnZeroExitCode
|
2021-12-08 16:02:06 +03:00
|
|
|
"sudo systemctl stop mysql" | Should -ReturnZeroExitCode
|
2020-12-30 18:04:55 +03:00
|
|
|
}
|
2021-01-08 16:02:09 +03:00
|
|
|
}
|