mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-17 17:27:57 +00:00
PMM-8575 Fixed test
Fixed sandbox used by go programs, updated all tests.
This commit is contained in:
61
go.mod
Normal file
61
go.mod
Normal file
@@ -0,0 +1,61 @@
|
||||
module github.com/percona/percona-toolkit
|
||||
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
github.com/Masterminds/semver v1.4.2
|
||||
github.com/alecthomas/kingpin v2.2.6+incompatible
|
||||
github.com/go-ini/ini v1.46.0
|
||||
github.com/golang/mock v1.3.1-0.20190508161146-9fa652df1129
|
||||
github.com/google/uuid v1.1.1
|
||||
github.com/hashicorp/go-version v1.2.1-0.20190424083514-192140e6f3e6
|
||||
github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c
|
||||
github.com/lib/pq v1.2.0
|
||||
github.com/mattn/go-shellwords v1.0.6
|
||||
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe
|
||||
github.com/pborman/getopt v0.0.0-20190409184431-ee0cd42419d3
|
||||
github.com/percona/go-mysql v0.0.0-20190903141930-197f4ad8db8d
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/prometheus/common v0.13.0
|
||||
github.com/shirou/gopsutil v2.20.8+incompatible
|
||||
github.com/sirupsen/logrus v1.6.0
|
||||
github.com/stretchr/testify v1.6.1
|
||||
go.mongodb.org/mongo-driver v1.7.1
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
|
||||
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
|
||||
k8s.io/api v0.18.6
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
|
||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/go-ole/go-ole v1.2.4 // indirect
|
||||
github.com/go-stack/stack v1.8.0 // indirect
|
||||
github.com/gogo/protobuf v1.3.1 // indirect
|
||||
github.com/golang/snappy v0.0.2-0.20190904063534-ff6b7dc882cf // indirect
|
||||
github.com/google/gofuzz v1.1.0 // indirect
|
||||
github.com/json-iterator/go v1.1.10 // indirect
|
||||
github.com/klauspost/compress v1.10.10 // indirect
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
|
||||
github.com/xdg-go/scram v1.0.2 // indirect
|
||||
github.com/xdg-go/stringprep v1.0.2 // indirect
|
||||
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
|
||||
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da // indirect
|
||||
golang.org/x/text v0.3.6 // indirect
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/ini.v1 v1.62.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.3.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
|
||||
k8s.io/apimachinery v0.18.6 // indirect
|
||||
k8s.io/klog v1.0.0 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v3 v3.0.0 // indirect
|
||||
)
|
32
src/go/docker/scripts/init-shard.sh
Executable file
32
src/go/docker/scripts/init-shard.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
mongodb1=`getent hosts ${MONGOS} | awk '{ print $1 }'`
|
||||
|
||||
mongodb11=`getent hosts ${MONGO11} | awk '{ print $1 }'`
|
||||
mongodb12=`getent hosts ${MONGO12} | awk '{ print $1 }'`
|
||||
mongodb13=`getent hosts ${MONGO13} | awk '{ print $1 }'`
|
||||
|
||||
mongodb21=`getent hosts ${MONGO21} | awk '{ print $1 }'`
|
||||
mongodb22=`getent hosts ${MONGO22} | awk '{ print $1 }'`
|
||||
mongodb23=`getent hosts ${MONGO23} | awk '{ print $1 }'`
|
||||
|
||||
mongodb31=`getent hosts ${MONGO31} | awk '{ print $1 }'`
|
||||
mongodb32=`getent hosts ${MONGO32} | awk '{ print $1 }'`
|
||||
mongodb33=`getent hosts ${MONGO33} | awk '{ print $1 }'`
|
||||
|
||||
port=${PORT:-27017}
|
||||
|
||||
echo "Waiting for startup.."
|
||||
until mongo --host ${mongodb1}:${port} --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' &>/dev/null; do
|
||||
printf '.'
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "Started.."
|
||||
|
||||
echo init-shard.sh time now: `date +"%T" `
|
||||
mongo --host ${mongodb1}:${port} <<EOF
|
||||
sh.addShard( "${RS1}/${mongodb11}:${PORT1},${mongodb12}:${PORT2},${mongodb13}:${PORT3}" );
|
||||
sh.addShard( "${RS2}/${mongodb21}:${PORT1},${mongodb22}:${PORT2},${mongodb23}:${PORT3}" );
|
||||
sh.status();
|
||||
EOF
|
40
src/go/docker/scripts/setup.sh
Executable file
40
src/go/docker/scripts/setup.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
mongodb1=`getent hosts ${MONGO1} | awk '{ print $1 }'`
|
||||
mongodb2=`getent hosts ${MONGO2} | awk '{ print $1 }'`
|
||||
mongodb3=`getent hosts ${MONGO3} | awk '{ print $1 }'`
|
||||
|
||||
port=${PORT:-27017}
|
||||
|
||||
echo "Waiting for startup.."
|
||||
until mongo --host ${mongodb1}:${port} --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' &>/dev/null; do
|
||||
printf '.'
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "Started.."
|
||||
|
||||
echo setup.sh time now: `date +"%T" `
|
||||
mongo --host ${mongodb1}:${port} <<EOF
|
||||
var cfg = {
|
||||
"_id": "${RS}",
|
||||
"protocolVersion": 1,
|
||||
"members": [
|
||||
{
|
||||
"_id": 0,
|
||||
"host": "${mongodb1}:${port}"
|
||||
},
|
||||
{
|
||||
"_id": 1,
|
||||
"host": "${mongodb2}:${port}"
|
||||
},
|
||||
{
|
||||
"_id": 2,
|
||||
"host": "${mongodb3}:${port}"
|
||||
}
|
||||
]
|
||||
};
|
||||
rs.initiate(cfg, { force: true });
|
||||
rs.reconfig(cfg, { force: true });
|
||||
EOF
|
||||
|
Reference in New Issue
Block a user