-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add e2e test script and docker support
Signed-off-by: Dweb Fan <[email protected]>
- Loading branch information
Showing
15 changed files
with
159 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,4 +44,4 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
- run: make test | ||
- run: make unit-tests |
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,3 @@ | ||
[submodule "test/data"] | ||
path = test/data | ||
url = https://github.com/lomorage/homepage |
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
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,6 @@ | ||
FROM "lomorage/lomo-backup:build-stage1" | ||
|
||
COPY ./dockerfiles/entrypoint-build.sh /entrypoint.sh | ||
RUN chmod 755 /entrypoint.sh | ||
|
||
ENTRYPOINT /entrypoint.sh "$@" |
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,24 @@ | ||
#!/bin/bash | ||
|
||
set -x | ||
|
||
dockerd -s vfs & | ||
|
||
# Check if `docker ps` command works, otherwise retry | ||
while true; do | ||
if docker ps; then | ||
echo "Docker is running!" | ||
break | ||
else | ||
echo "Docker is not yet ready. Retrying in 5 seconds..." | ||
sleep 5 | ||
fi | ||
done | ||
|
||
cd /root; gunzip localstack_3.4.0.tar.gz; docker load -i localstack_3.4.0.tar | ||
|
||
pkill -9 dockerd | ||
|
||
rm /var/run/docker.pid | ||
|
||
$@ |
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 @@ | ||
127.0.0.1 lomo-backup |
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,20 @@ | ||
[Unit] | ||
Description=Localstack service | ||
After=network-online.target docker.socket firewalld.service containerd.service time-set.target docker.service | ||
Wants=network-online.target containerd.service docker.service | ||
Requires=docker.service | ||
|
||
[Service] | ||
Type=simple | ||
# the default is not to use systemd for cgroups because the delegate issues still | ||
# exists and systemd currently does not support the cgroup feature set required | ||
# for containers run by docker | ||
ExecStart=docker run --name localstack -p 4566:4566 -p 4510-4559:4510-4559 localstack/localstack:3.4.0 | ||
ExecReload=docker rm -f localstack | ||
RestartSec=2 | ||
Restart=always | ||
|
||
WillMode = process | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
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,20 @@ | ||
sqlite3 ./lomob.db < ../../common/dbx/schema/1.sql | ||
|
||
lomob scan -t 1 ../data | ||
|
||
expectTotalDirs=58 | ||
expectTotalFiles=201 | ||
|
||
data=`sqlite3 ./lomob.db "select count(*) from dirs"` | ||
if [ "$data" = "$expectTotalDirs" ]; then | ||
echo "Number of scanned dirs pass" | ||
else | ||
echo "Number of scanned dirs is $data while expect $expectTotalDirs, failed!" | ||
fi | ||
|
||
data=`sqlite3 ./lomob.db "select count(*) from files"` | ||
if [ "$data" = "$expectTotalFiles" ]; then | ||
echo "Number of scanned files pass" | ||
else | ||
echo "Number of scanned file is $data while expect $expectTotalFiles, failed!" | ||
fi |