diff --git a/test/Dockerfile b/test/Dockerfile new file mode 100644 index 0000000..472255d --- /dev/null +++ b/test/Dockerfile @@ -0,0 +1,15 @@ +ARG ENGINE_VERSION=5.7.0 +FROM registry.gitlab.com/minetest/minetest/server:${ENGINE_VERSION} + +# copy old v1 maildb for migration testing +COPY ./mail.db /root/.minetest/worlds/world/mail.db +# copy old v2 mail-dir and auth.sqlite for migration testing +COPY ./old_v2_player.json /root/.minetest/worlds/world/mails/ +COPY ./auth.sqlite /root/.minetest/worlds/world/auth.sqlite + +USER root +RUN apk add git &&\ + mkdir -p /root/.minetest/worlds/world/worldmods/ &&\ + git clone https://github.com/BuckarooBanzay/mtt /root/.minetest/worlds/world/worldmods/mtt + +ENTRYPOINT minetestserver --config /minetest.conf \ No newline at end of file diff --git a/test/auth.sqlite b/test/auth.sqlite new file mode 100644 index 0000000..e6bac67 Binary files /dev/null and b/test/auth.sqlite differ diff --git a/test/mail.db b/test/mail.db new file mode 100644 index 0000000..3104acb --- /dev/null +++ b/test/mail.db @@ -0,0 +1 @@ +local _={};_[1]="singleplayer";return {old_v1_player={{unread=true,subject="test1",sender=_[1],body="test2"}},[_[1]]={}} \ No newline at end of file diff --git a/test/minetest.conf b/test/minetest.conf new file mode 100644 index 0000000..afea5f2 --- /dev/null +++ b/test/minetest.conf @@ -0,0 +1,4 @@ +default_game = minetest_game +mg_name = v7 +mtt_enable = true +mtt_filter = mail \ No newline at end of file diff --git a/test/old_v2_player.json b/test/old_v2_player.json new file mode 100644 index 0000000..2bb859a --- /dev/null +++ b/test/old_v2_player.json @@ -0,0 +1 @@ +[{"body":"test2","sender":"someone-else","subject":"test1","time":1678467148,"unread":false}] \ No newline at end of file