Behat: example.org is unreliable for anti-spam

Bug #1953541 reported by Gold
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Expired
Undecided
Unassigned

Bug Description

This feature is failing on the main branch.

./mahara_behat.sh rundebug settings/register_configuration.feature

And I press "Register"
And I should be on "/register.php"
And I should see "You have successfully [...snip...] processed."
      The text "You have successfully [...snip...] processed." was not found anywhere in the text of the current page.

I added a breakpoint and took a look at the page. The form does report the attached error, and the content of the form looks okay. The error doesn't indicate which field is the issue either.

I tried adding a second institution and selecting that just in case. It didn't change the outcome.

Further investigation has tracked this to the anti-spam we use. Turns out the domain 'example.org' may not be the best to test against.

On htdocs/lib/antispam/AdvancedSpamTrap.php line 35 we check the validity of the domain name by checking for MX, A, and AAAA records. This was my local results:

gold@shipnet:~/Mahara/codereview/test/behat ((baa775acad...)) $ php -a
Interactive mode enabled

php > $domain = 'example.org';
php > echo (checkdnsrr($domain, 'MX'))?'Y':'N';
N
php > echo (checkdnsrr($domain, 'A'))?'Y':'N';
N
php > echo (checkdnsrr($domain, 'AAAA'))?'Y':'N';
N
php > $domain = 'example.com';
php > echo (checkdnsrr($domain, 'MX'))?'Y':'N';
N
php > echo (checkdnsrr($domain, 'A'))?'Y':'N';
Y
php > echo (checkdnsrr($domain, 'AAAA'))?'Y':'N';
N
php >

At this point I would be inclined to be swapping out instances of `example.org` for `example.com` (or at least another domain we can rely on) in the behat tests.

Tags: behat-test
Revision history for this message
Gold (gold.catalyst) wrote :
Revision history for this message
Robert Lyon (robertl-9) wrote :

It's failing at the spamtrap check in htdocs/auth/lib.php line 3254 - so not an issue with the behat test but an issue with the spamtrap checker
I suspect one of the spam checkers is timing out and so causing the form validation to fail

Gold (gold.catalyst)
description: updated
summary: - Behat: settings/register_configuration.feature
+ Behat: example.org is unreliable for anti-spam
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote (last edit ):

Do we need to have the spam settings set for this test? Both example.org and example.com are domains that can be used for illustrative purposes.

Changed in mahara:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Mahara because there has been no activity for 60 days.]

Changed in mahara:
status: Incomplete → Expired
Revision history for this message
Robert Lyon (robertl-9) wrote :

The failings here only occur when there is DNS issues at example.org / example.com

And looking at the answer section from dig:

dig example.org

;; ANSWER SECTION:
example.org. 33350 IN A 93.184.216.34

dig example.com

;; ANSWER SECTION:
example.com. 86400 IN A 93.184.216.34

They resolve to the same place so using one of the other may not give us peace of mind - we just have to cope with their DNS being down / broken once in a while.

The official documentation at https://www.iana.org/domains/reserved mentions that these are the proper domains to use for this purpose, it says:

IANA-managed Reserved Domains

Certain domains are set aside, and nominally registered to “IANA”, for specific policy or technical purposes.

Example domains

As described in RFC 2606 and RFC 6761, a number of domains such as example.com and example.org are maintained for documentation purposes. These domains may be used as illustrative examples in documents without prior coordination with us.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.