Skip to content

Commit 67f1f12

Browse files
committed
test: add tests
1 parent f21bf9a commit 67f1f12

File tree

19 files changed

+62
-1
lines changed

19 files changed

+62
-1
lines changed

features/test/base/test.sh

Lines changed: 3 additions & 0 deletions
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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@ source dev-container-features-test-lib
55

66
check "/usr/local/bin/cron-control-runner exists and is executable" test -x /usr/local/bin/cron-control-runner
77
check "/usr/local/bin/wp exists and is executable" test -x /usr/local/bin/wp
8-
check "/usr/local/bin/wp.phar exists and is a symlink" test -L /usr/local/bin/wp.phar
8+
check "/usr/local/bin/wp.phar exists" test -f /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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 5 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
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)"

0 commit comments

Comments
 (0)