-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·43 lines (37 loc) · 1.32 KB
/
test.sh
File metadata and controls
executable file
·43 lines (37 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
set -o errexit
set -o pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
WASMTIME=${WASMTIME:-wasmtime}
store_type="${store_type:-filesystem}"
service_type="${service_type:-${store_type}}"
if [ -z ${SKIP_BUILD+x} ]; then
./build.sh "${cred_store_type:-${store_type}}"
fi
componentized_services() {
${WASMTIME} run -Sconfig -Sinherit-network \
-Sconfig-var=path=services \
--env log_context_kv2fs \
-Sconfig-var=binding-id="${binding_id}" \
--dir "${SCRIPT_DIR}/tests/testdata"::/ \
"${SCRIPT_DIR}/lib/test/cli.wasm" \
$@
}
instance_id=$(componentized_services provision --type "${service_type}")
componentized_services list-bindings ${instance_id}
binding_id=$(componentized_services bind ${instance_id})
componentized_services list-bindings ${instance_id}
componentized_services credentials fetch ${binding_id}
sleep 3
componentized_services ops write foo 'Hello'
componentized_services ops list /
sleep 1
componentized_services ops move foo bar
componentized_services ops list /
sleep 1
componentized_services ops read bar
sleep 1
componentized_services ops delete bar
componentized_services unbind ${binding_id} ${instance_id}
componentized_services list-bindings ${instance_id}
componentized_services destroy ${instance_id} --retain false