File: basic-tests

package info (click to toggle)
oca-core 11.0.20180730-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 509,684 kB
  • sloc: xml: 258,806; python: 164,081; sql: 217; sh: 92; makefile: 16
file content (47 lines) | stat: -rwxr-xr-x 1,221 bytes parent folder | download
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
#!/bin/sh

OCA_URL=http://localhost:8069

# Configure master password
if ! grep -q ^admin_passwd /etc/odoo/odoo.conf; then
    echo "admin_passwd = test1234" >>/etc/odoo/odoo.conf
fi

systemctl restart oca-core.service
systemctl status oca-core.service

nb_tries=1
while [ $nb_tries -le 4 ]; do
    sleep 5
    echo "Try #$nb_tries to fetch $OCA_URL/web"
    if curl -s -L $OCA_URL/web >$AUTOPKGTEST_TMP/web.html; then
	break
    else
	nb_tries=$(($nb_tries + 1))
    fi
done

if ! grep -q "Odoo is up and running" $AUTOPKGTEST_TMP/web.html; then
    echo "ERROR: Odoo is not up and running :-("
    echo "Output of curl -L $OCA_URL/web:"
    cat $AUTOPKGTEST_TMP/web.html
    exit 1
fi

echo "Instructing Odoo to create a database"
curl -s -L -d master_pwd=test1234 \
     -d name=odoo \
     -d login=hertzog@debian.org \
     -d password=test4321 \
     -d lang=en_US \
     -d country=us \
     $OCA_URL/web/database/create >$AUTOPKGTEST_TMP/create.html

if ! su - postgres -c "psql -l" | grep -q odoo; then
    echo "ERROR: Odoo failed to create the database"
    echo "List of existing databases:"
    su - postgres -c "psql -l"
    echo "Output of POST request:"
    cat $AUTOPKGTEST_TMP/create.html
    exit 1
fi