Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/ejabberd: Fix tests #97526

Merged
merged 1 commit into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions nixos/tests/xmpp/ejabberd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import ../make-test-python.nix ({ pkgs, ... }: {
};
nodes = {
client = { nodes, pkgs, ... }: {
networking.extraHosts = ''
${nodes.server.config.networking.primaryIPAddress} example.com
'';

environment.systemPackages = [
(pkgs.callPackage ./xmpp-sendmessage.nix { connectTo = nodes.server.config.networking.primaryIPAddress; })
];
Expand Down Expand Up @@ -46,6 +50,11 @@ import ../make-test-python.nix ({ pkgs, ... }: {
module: ejabberd_service
access: local
shaper: fast
-
port: 5444
module: ejabberd_http
request_handlers:
"/upload": mod_http_upload

## Disabling digest-md5 SASL authentication. digest-md5 requires plain-text
## password storage (see auth_password_format option).
Expand Down Expand Up @@ -180,16 +189,17 @@ import ../make-test-python.nix ({ pkgs, ... }: {
mod_client_state: {}
mod_configure: {} # requires mod_adhoc
## mod_delegation: {} # for xep0356
mod_disco: {}
#mod_irc:
# host: "irc.@HOST@"
# default_encoding: "utf-8"
## mod_bosh: {}
## mod_http_fileserver:
## docroot: "/var/www"
## accesslog: "/var/log/ejabberd/access.log"
#mod_http_upload:
# thumbnail: false # otherwise needs the identify command from ImageMagick installed
# put_url: "https://@HOST@:5444"
mod_http_upload:
thumbnail: false # otherwise needs the identify command from ImageMagick installed
put_url: "http://@HOST@:5444/upload"
## # docroot: "@HOME@/upload"
#mod_http_upload_quota:
# max_days: 14
Expand Down
6 changes: 5 additions & 1 deletion nixos/tests/xmpp/xmpp-sendmessage.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ class CthonTest(ClientXMPP):
def timeout_callback(arg):
log.error("ERROR: Cannot upload file. XEP_0363 seems broken")
sys.exit(1)
url = await self['xep_0363'].upload_file("${dummyFile}",timeout=10, timeout_callback=timeout_callback)
try:
url = await self['xep_0363'].upload_file("${dummyFile}",timeout=10, timeout_callback=timeout_callback)
except:
log.error("ERROR: Cannot run upload command. XEP_0363 seems broken")
sys.exit(1)
log.info('Upload success!')
# Test MUC
self.plugin['xep_0045'].join_muc('testMucRoom', 'cthon98', wait=True)
Expand Down