add test direcotry

This commit is contained in:
Aleksej
2022-06-13 19:33:08 +02:00
parent 84ac77f65f
commit ca29f42564
6 changed files with 177 additions and 0 deletions

26
test/test.sh Executable file
View 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