Skip to content

Instantly share code, notes, and snippets.

@arunapiravi
Created February 28, 2017 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arunapiravi/1741126dd38ba00fa5c6c645d4955330 to your computer and use it in GitHub Desktop.
Save arunapiravi/1741126dd38ba00fa5c6c645d4955330 to your computer and use it in GitHub Desktop.
./testrunner -i INI_FILE.ini GROUP=P0,cluster=D+F,skip-cleanup=True -t fts.rbac_fts.RbacFTS.test_fts_admin_permissions,users="""[{"id": "johnDoe", "name": "Jonathan Downing", "password": "password1", "roles": "fts_admin[sasl_bucket_1]:bucket_admin[sasl_bucket_1]"}]""",sasl_buckets=1,default_bucket=False,GROUP=P0
Test Input params:
{'GROUP': 'P0', 'users': '"""[{"id": "johnDoe", "name": "Jonathan Downing", "password": "password1", "roles": "fts_admin[sasl_bucket_1]:bucket_admin[sasl_bucket_1]"}]"""', 'skip-cleanup': 'True', 'conf_file': 'conf/fts/py-fts-rbac.conf', 'num_nodes': 4, 'cluster_name': 'INI_FILE', 'cluster': 'D+F', 'ini': 'INI_FILE.ini', 'case_number': 6, 'sasl_buckets': '1', 'logs_folder': '/Users/apiravi/testrunner/logs/testrunner-17-Feb-27_20-25-07/test_6', 'spec': 'py-fts-rbac', 'default_bucket': 'False'}
test_fts_admin_permissions (fts.rbac_fts.RbacFTS) ... [2017-02-27 20:40:13,811] - [fts_base:2811] INFO - ==== FTSbasetests setup is started for test #6 test_fts_admin_permissions ====
[2017-02-27 20:40:14,085] - [fts_base:1716] INFO - removing nodes from cluster ...
[2017-02-27 20:40:14,348] - [fts_base:1718] INFO - cleanup [ip:172.23.106.139 port:8091 ssh_username:root]
[2017-02-27 20:40:14,720] - [bucket_helper:138] INFO - deleting existing buckets [u'default', u'sasl_bucket_1'] on 172.23.106.139
[2017-02-27 20:40:14,721] - [bucket_helper:140] INFO - remove bucket default ...
[2017-02-27 20:40:16,129] - [bucket_helper:154] INFO - deleted bucket : default from 172.23.106.139
[2017-02-27 20:40:16,130] - [bucket_helper:230] INFO - waiting for bucket deletion to complete....
[2017-02-27 20:40:16,281] - [rest_client:134] INFO - node 172.23.106.139 existing buckets : [u'sasl_bucket_1']
[2017-02-27 20:40:16,282] - [bucket_helper:140] INFO - remove bucket sasl_bucket_1 ...
[2017-02-27 20:40:18,126] - [bucket_helper:154] INFO - deleted bucket : sasl_bucket_1 from 172.23.106.139
[2017-02-27 20:40:18,126] - [bucket_helper:230] INFO - waiting for bucket deletion to complete....
[2017-02-27 20:40:18,272] - [rest_client:134] INFO - node 172.23.106.139 existing buckets : []
[2017-02-27 20:40:18,982] - [cluster_helper:78] INFO - waiting for ns_server @ 172.23.106.139:8091
[2017-02-27 20:40:19,129] - [cluster_helper:80] INFO - ns_server @ 172.23.106.139:8091 is running
[2017-02-27 20:40:19,130] - [fts_base:1661] INFO - Initializing Cluster ...
[2017-02-27 20:40:20,098] - [task:117] INFO - server: ip:172.23.106.139 port:8091 ssh_username:root, nodes/self: {'ip': u'172.23.106.139', 'availableStorage': [], 'rest_username': '', 'id': u'ns_1@172.23.106.139', 'uptime': u'429066', 'mcdMemoryReserved': 4662, 'hostname': u'172.23.106.139:8091', 'storage': [<membase.api.rest_client.NodeDataStorage object at 0x10f713590>], 'moxi': 11211, 'port': u'8091', 'version': u'5.0.0-2012-enterprise', 'memcached': 11210, 'status': u'healthy', 'clusterCompatibility': 327680, 'curr_items': 0, 'services': [u'fts', u'kv'], 'rest_password': '', 'clusterMembership': u'active', 'memoryFree': 5248245760, 'memoryTotal': 6111358976, 'memoryQuota': 3108, 'mcdMemoryAllocated': 4662, 'os': u'x86_64-unknown-linux-gnu', 'ports': []}
[2017-02-27 20:40:20,098] - [rest_client:891] INFO - pools/default params : memoryQuota=3108
[2017-02-27 20:40:20,228] - [rest_client:928] INFO - settings/indexes params : storageMode=forestdb
[2017-02-27 20:40:20,375] - [rest_client:807] INFO - settings/web params on 172.23.106.139:8091:username=Administrator&password=password&port=8091
[2017-02-27 20:40:22,021] - [rest_client:1304] INFO - rebalance params : password=password&ejectedNodes=&user=Administrator&knownNodes=ns_1%40172.23.106.139
[2017-02-27 20:40:22,150] - [rest_client:1308] INFO - rebalance operation started
[2017-02-27 20:40:22,428] - [task:537] INFO - rebalancing was completed with progress: 100% in 0.277151107788 sec
[2017-02-27 20:40:23,963] - [rest_client:1951] INFO - http://172.23.106.139:8091/pools/default/buckets with param: bucketType=membase&evictionPolicy=valueOnly&threadsNumber=3&ramQuotaMB=2608&proxyPort=11211&authType=sasl&name=sasl_bucket_1&flushEnabled=1&replicaNumber=1&replicaIndex=1&saslPassword=password
[2017-02-27 20:40:24,097] - [rest_client:1979] INFO - 0.13 seconds to create bucket sasl_bucket_1
[2017-02-27 20:40:24,098] - [bucket_helper:322] INFO - waiting for memcached bucket : sasl_bucket_1 in 172.23.106.139 to accept set ops
[2017-02-27 20:40:26,415] - [data_helper:295] INFO - creating direct client 172.23.106.139:11210 sasl_bucket_1
[2017-02-27 20:40:27,807] - [data_helper:295] INFO - creating direct client 172.23.106.139:11210 sasl_bucket_1
[2017-02-27 20:41:35,078] - [task:298] INFO - bucket 'sasl_bucket_1' was created with per node RAM quota: 2608
[2017-02-27 20:41:35,078] - [fts_base:2820] INFO - ==== FTSbasetests setup is finished for test #6 test_fts_admin_permissions ====
[2017-02-27 20:41:35,979] - [data_helper:295] INFO - creating direct client 172.23.106.139:11210 sasl_bucket_1
[2017-02-27 20:41:39,214] - [fts_base:3741] INFO - Loading phase complete!
[2017-02-27 20:41:39,492] - [rest_client:790] ERROR - http://172.23.106.139:8091/settings/rbac/users/builtin/johnDoe error 404 reason: unknown "User was not found."
[2017-02-27 20:41:39,492] - [internal_user:36] INFO - Exception while deleting user. Exception is -"User was not found."
name=Jonathan Downing&roles=&password=password1
[2017-02-27 20:41:39,895] - [rbac_fts:33] INFO - SUCCESS: User(s) Jonathan Downing created
name=Jonathan Downing&roles=bucket_admin[sasl_bucket_1],fts_admin[sasl_bucket_1],
[2017-02-27 20:41:40,169] - [rbac_fts:44] INFO - SUCCESS: Role(s) fts_admin[sasl_bucket_1]:bucket_admin[sasl_bucket_1] assigned to johnDoe
{u'cluster.bucket[sasl_bucket_1].fts!read': True, u'cluster.bucket[sasl_bucket_1].fts!create': True, u'cluster.bucket[sasl_bucket_1].fts!manage': True}
[2017-02-27 20:41:40,677] - [rbac_fts:141] INFO - Permissions for user: johnDoe on bucket sasl_bucket_1 is: {u'cluster.bucket[sasl_bucket_1].fts!read': True, u'cluster.bucket[sasl_bucket_1].fts!create': True, u'cluster.bucket[sasl_bucket_1].fts!manage': True}
[2017-02-27 20:41:41,366] - [fts_base:869] INFO - Checking if index already exists ...
[2017-02-27 20:41:41,505] - [rest_client:790] ERROR - http://172.23.106.139:8094/api/index/johnDoe_sasl_bucket_1_idx error 403 reason: status: 403, content: rest_auth: preparePerm, err: index not found
rest_auth: preparePerm, err: index not found
[2017-02-27 20:41:41,624] - [rest_client:790] ERROR - http://172.23.106.139:8094/api/index/johnDoe_sasl_bucket_1_idx error 403 reason: status: 403, content: rest_auth: preparePerm, err: index not found
rest_auth: preparePerm, err: index not found
[2017-02-27 20:41:41,625] - [fts_base:878] INFO - Creating fulltext-index johnDoe_sasl_bucket_1_idx on 172.23.106.139
[2017-02-27 20:41:41,625] - [rest_client:2296] INFO - {"params": {}, "name": "johnDoe_sasl_bucket_1_idx", "planParams": {}, "sourceName": "sasl_bucket_1", "sourceUUID": "", "sourceType": "couchbase", "type": "fulltext-index", "sourceParams": {"authUser": "default", "dataManagerSleepMaxMS": 20000, "authSaslUser": "", "clusterManagerSleepMaxMS": 20000, "authSaslPassword": "", "clusterManagerSleepInitMS": 0, "dataManagerBackoffFactor": 0, "authPassword": "", "dataManagerSleepInitMS": 0, "feedBufferAckThreshold": 0, "feedBufferSizeBytes": 0, "clusterManagerBackoffFactor": 0}, "uuid": ""}
[2017-02-27 20:41:41,800] - [rest_client:2305] INFO - Index johnDoe_sasl_bucket_1_idx created
[2017-02-27 20:41:42,848] - [fts_base:869] INFO - Checking if index already exists ...
[2017-02-27 20:41:43,076] - [rest_client:790] ERROR - http://172.23.106.139:8094/api/index/johnDoe_sasl_bucket_1_alias error 403 reason: unknown {"message":"Forbidden. User needs one of the following permissions","permissions":["cluster.bucket.fts!write"]}
[2017-02-27 20:41:43,077] - [fts_base:878] INFO - Creating fulltext-alias johnDoe_sasl_bucket_1_alias on 172.23.106.139
[2017-02-27 20:41:43,077] - [rest_client:2296] INFO - {"params": {"targets": {"johnDoe_sasl_bucket_1_idx": {"indexUUID": "745910be796a4d9d"}}}, "name": "johnDoe_sasl_bucket_1_alias", "planParams": {}, "sourceName": "", "sourceUUID": "", "sourceType": "nil", "type": "fulltext-alias", "sourceParams": {"authUser": "default", "dataManagerSleepMaxMS": 20000, "authSaslUser": "", "clusterManagerSleepMaxMS": 20000, "authSaslPassword": "", "clusterManagerSleepInitMS": 0, "dataManagerBackoffFactor": 0, "authPassword": "", "dataManagerSleepInitMS": 0, "feedBufferAckThreshold": 0, "feedBufferSizeBytes": 0, "clusterManagerBackoffFactor": 0}, "uuid": ""}
[2017-02-27 20:41:43,246] - [rest_client:790] ERROR - http://172.23.106.139:8094/api/index/johnDoe_sasl_bucket_1_alias error 403 reason: unknown {"message":"Forbidden. User needs one of the following permissions","permissions":["cluster.bucket.fts!write"]}
FAIL
[2017-02-27 20:41:43,508] - [fts_base:3343] INFO - sleep for 20 secs. wait for user to get deleted... ...
[2017-02-27 20:42:03,509] - [rbac_fts:53] INFO - user roles revoked for johnDoe
[2017-02-27 20:42:03,509] - [fts_base:2877] WARNING - CLEANUP WAS SKIPPED
Cluster instance shutdown with force
======================================================================
FAIL: test_fts_admin_permissions (fts.rbac_fts.RbacFTS)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pytests/fts/rbac_fts.py", line 193, in test_fts_admin_permissions
" %s : %s" % (user['id'],e))
AssertionError: The user failed to create fts index/alias johnDoe : Error creating index: {"message":"Forbidden. User needs one of the following permissions","permissions":["cluster.bucket.fts!write"]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment