add test direcotry
This commit is contained in:
26
test/test.sh
Executable file
26
test/test.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
# Run ejabberd docker as a daemon
|
||||
docker run --name xmppbot-test -d -p 25222:5222 ejabberd/ecs
|
||||
|
||||
# Wait few seconds for ejabberd to boot
|
||||
sleep 5
|
||||
|
||||
# Create acounts for admin and xmppbot
|
||||
docker exec -it xmppbot-test bin/ejabberdctl register admin localhost admintestpassword
|
||||
|
||||
docker exec -it xmppbot-test bin/ejabberdctl register xmppbot localhost bottestpassword
|
||||
|
||||
# Create MUC rooms for testing
|
||||
docker exec -it xmppbot-test bin/ejabberdctl create_room testroom1 conference.localhost localhost
|
||||
docker exec -it xmppbot-test bin/ejabberdctl create_room testroom2 conference.localhost localhost
|
||||
|
||||
# Run xmpp mirror bot
|
||||
python3 ../xmppmirror &
|
||||
|
||||
# Run xmpp test bot
|
||||
python3 testbot
|
||||
|
||||
# Stop and remove containter
|
||||
docker stop xmppbot-test
|
||||
docker rm xmppbot-test
|
||||
|
Reference in New Issue
Block a user