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

test: sasl/binary-sasl.test.py fails #51

Open
Totktonada opened this issue Jul 29, 2019 · 3 comments
Open

test: sasl/binary-sasl.test.py fails #51

Totktonada opened this issue Jul 29, 2019 · 3 comments
Labels

Comments

@Totktonada
Copy link
Member

I'm going to disable the test in the scope of #49. It however need to be investigated and enabled back. Observed the following errors:

# cat test/var/binary-sasl.result
#---------------------------# sasl tests #--------------------------#
Error on line sasl/binary-sasl.test.py:97: 32 not equal 0
Error on line sasl/binary-sasl.test.py:53: 32 not equal 1
Error on line sasl/binary-sasl.test.py:102: 32 not equal 0
Error on line sasl/binary-sasl.test.py:45: -1 not equal 0
Error on line sasl/binary-sasl.test.py:107: 32 not equal 0
Error on line sasl/binary-sasl.test.py:53: 32 not equal 1
Error on line sasl/binary-sasl.test.py:112: 32 not equal 0
Error on line sasl/binary-sasl.test.py:45: -1 not equal 0
Error on line sasl/binary-sasl.test.py:53: 32 not equal 1
Error on line sasl/binary-sasl.test.py:137: 32 not equal 0
Error on line sasl/binary-sasl.test.py:139: 32 not equal 0
<<--------------------------------------------------
get foo

After that the test stuck.

If we'll install sasl2-bin package in test.sh (for saslpasswd2 tool, see test/sasl/sasl.lua) the errors will be gone, but the test still stucks:

# cat test/var/binary-sasl.result 
#---------------------------# sasl tests #--------------------------#
<<--------------------------------------------------
get foo
@Totktonada Totktonada added the QA label Jul 29, 2019
Totktonada added a commit that referenced this issue Jul 29, 2019
Don't sure about a reason of the fail. Filed #51 to enable it back.

Fixes #49.
Totktonada added a commit that referenced this issue Jul 29, 2019
Don't sure about a reason of the fail. Filed #51 to enable it back.

Fixes #49.
Totktonada added a commit that referenced this issue Jul 29, 2019
Don't sure about a reason of the fail. Filed #51 to enable it back.

Fixes #49.
Totktonada added a commit that referenced this issue Jul 29, 2019
Don't sure about a reason of the fail. Filed #51 to enable it back.

Fixes #49.
@LeonidVas LeonidVas added the backlog Issues for upcoming releases (to be done soon) label Dec 15, 2020
@Totktonada Totktonada removed backlog Issues for upcoming releases (to be done soon) prio6 labels Nov 15, 2021
@ligurio
Copy link
Member

ligurio commented Dec 16, 2021

With patch:

--- a/test/sasl/sasl.lua
+++ b/test/sasl/sasl.lua
@@ -67,6 +67,7 @@ env['SASL_CONF_PATH'] = fio.pathjoin(fio.cwd(), '../sasl/config/')
 box.cfg{
     wal_mode = 'none',
     slab_alloc_arena = 0.1,
+    log_level = 7,
 }
 
 local memcached = require('memcached')

log 'test/var/001_sasl/sasl.log' says:

2021-12-16 12:03:12.686 [1072974] main/123/server/127.0.0.1:33502 mc_sasl.c:142 E> SASL <level 2> Couldn't find mech XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
2021-12-16 12:03:12.686 [1072974] main/123/server/127.0.0.1:33502 mc_sasl.c:244 E> <memcached_sasl_auth>: Failed <sasl_server_start> with exit code -4
2021-12-16 12:03:12.686 [1072974] main/123/server/127.0.0.1:33502 mc_sasl.c:142 E> SASL <level 2> Password verification failed
2021-12-16 12:03:12.686 [1072974] main/123/server/127.0.0.1:33502 mc_sasl.c:244 E> <memcached_sasl_auth>: Failed <sasl_server_start> with exit code -20
2021-12-16 12:03:12.686 [1072974] main/123/server/127.0.0.1:33502 mc_sasl.c:142 E> SASL <level 2> Password verification failed
2021-12-16 12:03:12.686 [1072974] main/123/server/127.0.0.1:33502 mc_sasl.c:244 E> <memcached_sasl_auth>: Failed <sasl_server_start> with exit code -20
2021-12-16 12:03:12.689 [1072974] main/128/server/127.0.0.1:33512 mc_sasl.c:142 E> SASL <level 2> Password verification failed
2021-12-16 12:03:12.689 [1072974] main/128/server/127.0.0.1:33512 mc_sasl.c:244 E> <memcached_sasl_auth>: Failed <sasl_server_start> with exit code -20
2021-12-16 12:03:12.689 [1072974] main/129/server/127.0.0.1:33514 mc_sasl.c:142 E> SASL <level 2> Password verification failed
2021-12-16 12:03:12.689 [1072974] main/129/server/127.0.0.1:33514 mc_sasl.c:244 E> <memcached_sasl_auth>: Failed <sasl_server_start> with exit code -20
2021-12-16 12:03:12.690 [1072974] main/130/server/127.0.0.1:33516 mc_sasl.c:142 E> SASL <level 2> Password verification failed
2021-12-16 12:03:12.690 [1072974] main/130/server/127.0.0.1:33516 mc_sasl.c:244 E> <memcached_sasl_auth>: Failed <sasl_server_start> with exit code -20
2021-12-16 12:03:24.776 [1072974] main C> got signal 2 - Interrupt

@ligurio
Copy link
Member

ligurio commented Dec 16, 2021

Looks like SASL doesn't work:

$ pip2 install python-binary-memcached==0.27.0
$ cat sasl-client.py 
import bmemcached
client = bmemcached.Client(('127.0.0.1:8080', ), 'testuser', 'testpasswd')
client.set('key', 'value')
client.set('key1', 'value1')
print(client.get('key'))
print(client.get('key1'))
$ cat init.lua
box.cfg{
    log_level = 7,
    feedback_enabled = false,
}
mc = require('memcached')
m = mc.create('instance_1', '8080', {
    expire_enabled = false,
    verbosity = 3,
    sasl = true
})

require('console'):start()
$ export SASL_CONF_PATH=$(pwd)/test/sasl/config
$ tarantool init.lua
...
$ python2 sasl-client.py:
Traceback (most recent call last):
  File "sasl-client.py", line 3, in <module>
    client.set('key', 'value')
  File "/home/sergeyb/.local/lib/python2.7/site-packages/bmemcached/client/replicating.py", line 172, in set
    returns.append(server.set(key, value, time, compress_level=compress_level))
  File "/home/sergeyb/.local/lib/python2.7/site-packages/bmemcached/protocol.py", line 606, in set
    return self._set_add_replace('set', key, value, time, compress_level=compress_level)
  File "/home/sergeyb/.local/lib/python2.7/site-packages/bmemcached/protocol.py", line 573, in _set_add_replace
    time, str_to_bytes(key), value))
  File "/home/sergeyb/.local/lib/python2.7/site-packages/bmemcached/protocol.py", line 239, in _send
    self._open_connection()
  File "/home/sergeyb/.local/lib/python2.7/site-packages/bmemcached/protocol.py", line 151, in _open_connection
    self._send_authentication()
  File "/home/sergeyb/.local/lib/python2.7/site-packages/bmemcached/protocol.py", line 314, in _send_authentication
    raise MemcachedException('Code: %d Message: %s' % (status, extra_content), status)
bmemcached.exceptions.MemcachedException

Description of SASL commands is here https://github.com/couchbase/memcached/blob/master/docs/sasl.md
NOTE: SASL support has been added in c49af59.

@ligurio
Copy link
Member

ligurio commented Dec 16, 2021

Sample sasl-client.py described in previous comment works after fixes added to branch ligurio/gh-51-fix-sasl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants