File: functional

package info (click to toggle)
golang-github-lib-pq 1.10.9-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 724 kB
  • sloc: makefile: 35; sh: 14
file content (24 lines) | stat: -rwxr-xr-x 701 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
set -e

# autopkgtest-schroot will not automatically start Postgres upon installation,
# so start it manually here.
invoke-rc.d postgresql start
trap 'invoke-rc.d postgresql stop' EXIT

sed -i 's/peer$/trust/' /etc/postgresql/*/main/pg_hba.conf
invoke-rc.d postgresql reload

export PGHOST=/var/run/postgresql
export PGUSER=postgres

psql -U $PGUSER -c 'create database pqgotest'
psql -U $PGUSER -c 'create user pqgossltest'
psql -U $PGUSER -c 'create user pqgosslcert'

export GOPATH=/usr/share/gocode

# Run tests as unprivileged user
export GOCACHE=$(mktemp -d)
chown $AUTOPKGTEST_NORMAL_USER $GOCACHE
runuser -p -u $AUTOPKGTEST_NORMAL_USER -- go test -vet=off -v github.com/lib/pq/...