-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_writeread.sh
executable file
·75 lines (68 loc) · 2.63 KB
/
test_writeread.sh
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# This script will introduce some example data to Orchestrator, testing data read/write/deletion operations.
ADDRESS="127.0.0.1"
PORT="8998"
echo "Creating Cloud service..."
SERVICE_ID=$(curl -s -k --data "service_address=ffff:ffff:ffff:ffff" "https://$ADDRESS:$PORTcloud/add" 2>/dev/null)
SERVICE_ID2=$(curl -s -k "https://$ADDRESS:$PORT/cloud/ffff:ffff:ffff:ffff" 2>/dev/null)
echo $SERVICE_ID
echo $SERVICE_ID2
echo "--------"
echo "Creating DHCP service..."
SERVICE2_ID=$(curl -s -k --data "service_address=aaaa:aaaa:aaaa:aaaa" "https://$ADDRESS:$PORT/dhcp/add" 2>/dev/null)
SERVICE2_ID2=$(curl -s -k "https://$ADDRESS:$PORT/dhcp/aaaa:aaaa:aaaa:aaaa" 2>/dev/null)
echo $SERVICE2_ID
echo $SERVICE2_ID2
echo "-------"
read -n 1
echo "Creating instance..."
INSTANCE_ID=$(curl -s -k --data "server_id=$SERVICE_ID&instance_address=abbb:cccc:dddd:eeee&instance_duid=1234567890" "https://$ADDRESS:$PORT/instance/add" 2>/dev/null)
echo $INSTANCE_ID
echo "-------"
echo "Instance list:"
INSTANCE_LIST=$(curl -s -k "https://$ADDRESS:$PORT/instance" 2>/dev/null)
echo $INSTANCE_LIST
echo "-------"
read -n 1
echo "Creating client..."
CLIENT_ID=$(curl -s -k --data "server_id=$SERVICE2_ID&client_address=bbbb:aaaa:dddd:eeee&client_duid=0987654321" "https://$ADDRESS:$PORT/client/add" 2>/dev/null)
echo $CLIENT_ID
echo "-------"
echo "Client list:"
CLIENT_LIST=$(curl -s -k "https://$ADDRESS:$PORT/client" 2>/dev/null)
echo $CLIENT_LIST
echo "-------"
read -n 1
echo "Client delete:"
CLIENT_RM=$(curl -s -k --data "client_address=bbbb:aaaa:dddd:eeee" "https://$ADDRESS:$PORT/client/rm" 2>/dev/null)
echo $CLIENT_RM
echo "------"
echo "Client list:"
CLIENT_LIST=$(curl -s -k "https://$ADDRESS:$PORT/client" 2>/dev/null)
echo $CLIENT_LIST
echo "-------"
read -n 1
echo "Instance delete:"
INSTANCE_RM=$(curl -s -k --data "instance_address=abbb:cccc:dddd:eeee" "https://$ADDRESS:$PORT/instance/rm" 2>/dev/null)
echo $INSTANCE_RM
echo "------"
echo "Instance list:"
INSTANCE_LIST=$(curl -s -k "https://$ADDRESS:$PORT/instance" 2>/dev/null)
echo $INSTANCE_LIST
echo "-------"
echo "Deleting Cloud service..."
SERVICE_RM=$(curl -s -k --data "service_address=ffff:ffff:ffff:ffff" "https://$ADDRESS:$PORT/cloud/rm" 2>/dev/null)
echo $SERVICE_RM
echo "--------"
echo "Deleting DHCP service..."
SERVICE2_RM=$(curl -s -k --data "service_address=aaaa:aaaa:aaaa:aaaa" "https://$ADDRESS:$PORT/dhcp/rm" 2>/dev/null)
echo $SERVICE2_RM
echo "-------"
echo "Cloud list:"
SERVICE_LIST=$(curl -s -k "https://$ADDRESS:$PORT/cloud" 2>/dev/null)
echo $SERVICE_LIST
echo "-------"
echo "DHCP list:"
SERVICE2_LIST=$(curl -s -k "https://$ADDRESS:$PORT/dhcp" 2>/dev/null)
echo $SERVICE2_LIST
echo "-------"