Skip to content

Commit d4e3e74

Browse files
committed
test: add tests
1 parent f21bf9a commit d4e3e74

File tree

19 files changed

+61
-0
lines changed

19 files changed

+61
-0
lines changed

features/test/base/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ check "${HOME}/.local/share/vip-codespaces/login/001-welcome.sh exists" test -f
1313
check "LD_PRELOAD is set correctly" sh -c 'echo "${LD_PRELOAD}" | grep -q "/usr/lib/libeatmydata/libeatmydata.so"'
1414
check "/usr/lib/libeatmydata/libeatmydata.so exists" test -L /usr/lib/libeatmydata/libeatmydata.so
1515

16+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/base/devcontainer-feature.json exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/base/devcontainer-feature.json
17+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/base/devcontainer-features.env exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/base/devcontainer-features.env
18+
1619
# Microsoft's base images contain zsh. We don't want to run this check for MS images because we have no control over the installed services.
1720
if test -d /etc/rc2.d && ! test -e /usr/bin/zsh; then
1821
dir="$(ls -1 /etc/rc2.d)"

features/test/cron-control-runner/test.sh

+5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ check "/usr/local/bin/wp exists and is executable" test -x /usr/local/bin/wp
88
check "/usr/local/bin/wp.phar exists and is a symlink" test -L /usr/local/bin/wp.phar
99
check "/var/wpvip/fpm-cron-runner.php exists" test -f /var/wpvip/fpm-cron-runner.php
1010

11+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/cron-control-runner/devcontainer-feature.json exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/cron-control-runner/devcontainer-feature.json
12+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/cron-control-runner/devcontainer-features.env exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/cron-control-runner/devcontainer-features.env
13+
1114
if [[ -d /etc/sv ]]; then
1215
check "/etc/sv/cron-control-runner/run exists and is executable" test -x /etc/sv/cron-control-runner/run
1316
check "/etc/service/cron-control-runner exists and is a symlink" test -L /etc/service/cron-control-runner
1417
fi
18+
19+
reportResults

features/test/cron/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ check 'crond exists' which crond
88
check "crontab exists" which crontab
99
check "crontab has setuid or setgid bit" sh -c "stat -L -c %A /usr/bin/crontab | grep -F s"
1010

11+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/cron/devcontainer-feature.json exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/cron/devcontainer-feature.json
12+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/cron/devcontainer-features.env exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/cron/devcontainer-features.env
13+
1114
# Microsoft's base images contain zsh. We don't want to run this check for MS images because we have no control over the installed services.
1215
if test -d /etc/rc2.d && ! test -e /usr/bin/zsh; then
1316
dir="$(ls -1 /etc/rc2.d)"

features/test/desktop-lite/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ if [[ -d /etc/sv ]]; then
2222
check "/etc/service/openbox exists and is a symlink" test -L /etc/service/openbox
2323
fi
2424

25+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/desktop-lite/devcontainer-feature.json exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/desktop-lite/devcontainer-feature.json
26+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/desktop-lite/devcontainer-features.env exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/desktop-lite/devcontainer-features.env
27+
2528
# Microsoft's base images contain zsh. We don't want to run this check for MS images because we have no control over the installed services.
2629
if test -d /etc/rc2.d && ! test -e /usr/bin/zsh; then
2730
dir="$(ls -1 /etc/rc2.d)"

features/test/dev-tools/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ source dev-container-features-test-lib
55

66
check "/wp/wp-content/mu-plugins/dev-env-plugin.php exists" test -f /wp/wp-content/mu-plugins/dev-env-plugin.php
77

8+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/dev-tools/devcontainer-feature.json exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/dev-tools/devcontainer-feature.json
9+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/dev-tools/devcontainer-features.env exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/dev-tools/devcontainer-features.env
10+
811
# Microsoft's base images contain zsh. We don't want to run this check for MS images because we have no control over the installed services.
912
if test -d /etc/rc2.d && ! test -e /usr/bin/zsh; then
1013
dir="$(ls -1 /etc/rc2.d)"

features/test/elasticsearch/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ if [[ -d /etc/sv ]]; then
99
check "/etc/service/elasticsearch is a symlink" test -L /etc/service/elasticsearch
1010
fi
1111

12+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/elasticsearch/devcontainer-feature.json exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/elasticsearch/devcontainer-feature.json
13+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/elasticsearch/devcontainer-features.env exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/elasticsearch/devcontainer-features.env
14+
1215
# Microsoft's base images contain zsh. We don't want to run this check for MS images because we have no control over the installed services.
1316
if test -d /etc/rc2.d && ! test -e /usr/bin/zsh; then
1417
dir="$(ls -1 /etc/rc2.d)"

features/test/entrypoints/test.sh

+5
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ source dev-container-features-test-lib
55

66
check "/var/lib/entrypoint.d exists" test -d /var/lib/entrypoint.d
77
check "/usr/local/bin/entrypoint-runner exists and is executable" test -x /usr/local/bin/entrypoint-runner
8+
9+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/entrypoints/devcontainer-feature.json exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/entrypoints/devcontainer-feature.json
10+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/entrypoints/devcontainer-features.env exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/entrypoints/devcontainer-features.env
11+
12+
reportResults

features/test/mailpit/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ if [[ -d /etc/sv ]]; then
1010
check "/etc/service/mailpit is a symlink" test -L /etc/service/mailpit
1111
fi
1212

13+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/mailpit/devcontainer-feature.json exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/mailpit/devcontainer-feature.json
14+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/mailpit/devcontainer-features.env exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/mailpit/devcontainer-features.env
15+
1316
# Microsoft's base images contain zsh. We don't want to run this check for MS images because we have no control over the installed services.
1417
if test -d /etc/rc2.d && ! test -e /usr/bin/zsh; then
1518
dir="$(ls -1 /etc/rc2.d)"

features/test/mariadb/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ if [[ -d /etc/sv ]]; then
99
check "/etc/service/mariadb is a symlink" test -L /etc/service/mariadb
1010
fi
1111

12+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/mariadb/devcontainer-feature.json exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/mariadb/devcontainer-feature.json
13+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/mariadb/devcontainer-features.env exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/mariadb/devcontainer-features.env
14+
1215
# Microsoft's base images contain zsh. We don't want to run this check for MS images because we have no control over the installed services.
1316
if test -d /etc/rc2.d && ! test -e /usr/bin/zsh; then
1417
dir="$(ls -1 /etc/rc2.d)"

features/test/mc/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ source dev-container-features-test-lib
55

66
check "mc exists" which mc
77

8+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/mc/devcontainer-feature.json exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/mc/devcontainer-feature.json
9+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/mc/devcontainer-features.env exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/mc/devcontainer-features.env
10+
811
# Microsoft's base images contain zsh. We don't want to run this check for MS images because we have no control over the installed services.
912
if test -d /etc/rc2.d && ! test -e /usr/bin/zsh; then
1013
dir="$(ls -1 /etc/rc2.d)"

features/test/memcached/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ if [[ -d /etc/sv ]]; then
99
check "/etc/service/memcached is a symlink" test -L /etc/service/memcached
1010
fi
1111

12+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/memcached/devcontainer-feature.json exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/memcached/devcontainer-feature.json
13+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/memcached/devcontainer-features.env exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/memcached/devcontainer-features.env
14+
1215
# Microsoft's base images contain zsh. We don't want to run this check for MS images because we have no control over the installed services.
1316
if test -d /etc/rc2.d && ! test -e /usr/bin/zsh; then
1417
dir="$(ls -1 /etc/rc2.d)"

features/test/nginx/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ if [[ -d /etc/sv ]]; then
1818
check "/etc/service/nginx is a symlink" test -L /etc/service/nginx
1919
fi
2020

21+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/nginx/devcontainer-feature.json exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/nginx/devcontainer-feature.json
22+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/nginx/devcontainer-features.env exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/nginx/devcontainer-features.env
23+
2124
# Microsoft's base images contain zsh. We don't want to run this check for MS images because we have no control over the installed services.
2225
if test -d /etc/rc2.d && ! test -e /usr/bin/zsh; then
2326
dir="$(ls -1 /etc/rc2.d)"

features/test/php/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ if [[ -d /etc/sv ]]; then
3030
check "/etc/service/php-fpm is a symlink" test -L /etc/service/php-fpm
3131
fi
3232

33+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/php/devcontainer-feature.json exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/php/devcontainer-feature.json
34+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/php/devcontainer-features.env exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/php/devcontainer-features.env
35+
3336
# Microsoft's base images contain zsh. We don't want to run this check for MS images because we have no control over the installed services.
3437
if test -d /etc/rc2.d && ! test -e /usr/bin/zsh; then
3538
dir="$(ls -1 /etc/rc2.d)"

features/test/ssh/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ if [[ "$(id -u || true)" -eq 0 ]]; then
1111
check "/etc/ssh/sshd_config.d/permit_root_login.conf exists" test -f /etc/ssh/sshd_config.d/permit_root_login.conf
1212
fi
1313

14+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/ssh/devcontainer-feature.json exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/ssh/devcontainer-feature.json
15+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/ssh/devcontainer-features.env exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/ssh/devcontainer-features.env
16+
1417
# Microsoft's base images contain zsh. We don't want to run this check for MS images because we have no control over the installed services.
1518
if test -d /etc/rc2.d && ! test -e /usr/bin/zsh; then
1619
dir="$(ls -1 /etc/rc2.d)"

features/test/su-exec/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ if [[ "$(id -u || true)" -eq 0 ]]; then
1010
check "su-exec works (group)" sh -c 'su-exec bin:daemon id -gn | grep -F daemon'
1111
fi
1212

13+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/su-exec/devcontainer-feature.json exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/su-exec/devcontainer-feature.json
14+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/su-exec/devcontainer-features.env exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/su-exec/devcontainer-features.env
15+
1316
# Microsoft's base images contain zsh. We don't want to run this check for MS images because we have no control over the installed services.
1417
if test -d /etc/rc2.d && ! test -e /usr/bin/zsh; then
1518
dir="$(ls -1 /etc/rc2.d)"

features/test/vip-cli/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ check "VIP CLI exists" which vip
77
check "vip-sync-db exists" test -x /usr/local/bin/vip-sync-db
88
check "VIP CLI can run" vip --version
99

10+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/vip-cli/devcontainer-feature.json exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/vip-cli/devcontainer-feature.json
11+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/vip-cli/devcontainer-features.env exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/vip-cli/devcontainer-features.env
12+
1013
# Microsoft's base images contain zsh. We don't want to run this check for MS images because we have no control over the installed services.
1114
if test -d /etc/rc2.d && ! test -e /usr/bin/zsh; then
1215
dir="$(ls -1 /etc/rc2.d)"

features/test/vip-go-mu-plugins/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ check "rsync is executable" which rsync
77
check "git is executable" which git
88
check "/wp/wp-content/mu-plugins is a directory" test -d /wp/wp-content/mu-plugins
99

10+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/vip-go-mu-plugins/devcontainer-feature.json exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/vip-go-mu-plugins/devcontainer-feature.json
11+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/vip-go-mu-plugins/devcontainer-features.env exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/vip-go-mu-plugins/devcontainer-features.env
12+
1013
# Microsoft's base images contain zsh. We don't want to run this check for MS images because we have no control over the installed services.
1114
if test -d /etc/rc2.d && ! test -e /usr/bin/zsh; then
1215
dir="$(ls -1 /etc/rc2.d)"

features/test/wp-cli/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ source dev-container-features-test-lib
55

66
check "wp-cli exists" test -x /usr/local/bin/wp
77

8+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/wp-cli/devcontainer-feature.json exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/wp-cli/devcontainer-feature.json
9+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/wp-cli/devcontainer-features.env exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/wp-cli/devcontainer-features.env
10+
811
# Microsoft's base images contain zsh. We don't want to run this check for MS images because we have no control over the installed services.
912
if test -d /etc/rc2.d && ! test -e /usr/bin/zsh; then
1013
dir="$(ls -1 /etc/rc2.d)"

features/test/wptl/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ check "/usr/src/wordpress exists and is a directory" test -d /usr/src/wordpress
1212
check "/usr/local/bin/setup-wptl exists and is executable" test -x /usr/local/bin/setup-wptl
1313
check "/usr/local/bin/use-wptl exists and is executable" test -x /usr/local/bin/use-wptl
1414

15+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/wptl/devcontainer-feature.json exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/wptl/devcontainer-feature.json
16+
check "/usr/local/etc/vscode-dev-containers/vip-codespaces/wptl/devcontainer-features.env exists" test -f /usr/local/etc/vscode-dev-containers/vip-codespaces/wptl/devcontainer-features.env
17+
1518
# Microsoft's base images contain zsh. We don't want to run this check for MS images because we have no control over the installed services.
1619
if test -d /etc/rc2.d && ! test -e /usr/bin/zsh; then
1720
dir="$(ls -1 /etc/rc2.d)"

0 commit comments

Comments
 (0)