Skip to content

Commit edfe642

Browse files
UbuntuNikolayS
authored andcommitted
added dblab init wait, dblab instance status
1 parent 8a9f88e commit edfe642

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

test/1.synthetic.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ sudo docker rm dblab_pg_initdb
3636
### Step ?. Configure and launch the Database Lab server
3737
mkdir -p ~/.dblab
3838
cp ./configs/config.example.physical_generic.yml ~/.dblab/server_test.yml
39+
sed -ri 's/^(\s*)(host:.*$)/\1host: ""/' ~/.dblab/server_test.yml
3940
sed -ri 's/^(\s*)(port: 2345$)/\1port: 12345/' ~/.dblab/server_test.yml
4041
sed -ri 's/^(\s*)(debug:.*$)/\1debug: true/' ~/.dblab/server_test.yml
4142
sed -ri 's/^(\s*)(pool:.*$)/\1pool: "test_pool"/' ~/.dblab/server_test.yml
@@ -52,4 +53,15 @@ sudo docker run \
5253
--volume ~/.dblab/server_test.yml:/home/dblab/configs/config.yml \
5354
"${IMAGE2TEST}"
5455

55-
### Step ?. Setup Database Lab client CLI
56+
### Waiting fori dblab initialization
57+
while true; do
58+
curl http://localhost:12345 && break
59+
sleep 10
60+
done
61+
62+
### Step ?. Setup Dnd init atabase Lab client CLI
63+
curl https://gitlab.com/postgres-ai/database-lab/-/raw/master/scripts/cli_install.sh | bash
64+
dblab --version
65+
dblab init --url http://localhost:12345 --token secret_token --environment-id test
66+
dblab instance status
67+

test/_cleanup.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22
set -euxo pipefail
33

4+
45
ZFS_FILE="$(pwd)/zfs_file"
56

67
# TODO: docker rm for all containers that are related to dblab
@@ -10,6 +11,9 @@ sudo docker ps -a --filter 'label=dblab_control' \
1011
| sudo xargs --no-run-if-empty docker rm -f \
1112
|| true
1213
sudo zpool destroy test_pool || true
14+
sudo rm -rf /var/lib/dblab/data/
1315
sudo umount /var/lib/dblab/data || true
1416
sudo rm -f "${ZFS_FILE}"
1517
rm -f ~/.dblab/server_test.yml
18+
19+
dblab config remove test

test/_prerequisites.ubuntu.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ curl --version || sudo apt-get update && sudo apt-get install -y \
66
ca-certificates \
77
curl \
88
gnupg-agent \
9-
software-properties-common
9+
software-properties-common \
10+
curl
1011

1112
# ZFS
1213
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

0 commit comments

Comments
 (0)