Project

General

Profile

Bug #34381

Fix traceback in AFP share API

Added by Eric Turgeon over 2 years ago. Updated over 2 years ago.

Status:
Done
Priority:
No priority
Assignee:
Brandon Schneider
Category:
Middleware
Target version:
Severity:
Medium
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

Here is the output of the automation test ==================================================== test session starts =====================================================
platform freebsd12 -- Python 3.6.5, pytest-3.4.2, py-1.5.3, pluggy-0.6.0 -- /usr/local/bin/python3.6
cachedir: .pytest_cache
rootdir: /usr/home/ericbsd/projects/freenas/freenas/tests, inifile:
collected 31 items

api2/afp.py::test_01_creating_afp_dataset PASSED [ 3%]
api2/afp.py::test_02_changing_permissions_on_afp_path PASSED [ 6%]
api2/afp.py::test_03_setting_afp PASSED [ 9%]
api2/afp.py::test_04_enable_afp_service_at_boot PASSED [ 12%]
api2/afp.py::test_05_checking_afp_enable_at_boot PASSED [ 16%]
api2/afp.py::test_06_start_afp_service PASSED [ 19%]
api2/afp.py::test_07_checking_if_afp_is_running PASSED [ 22%]
api2/afp.py::test_08_creating_a_afp_share_on_afp_path PASSED [ 25%]
api2/afp.py::test_09_create_mount_point_for_afp_on_osx_system SKIPPED [ 29%]
api2/afp.py::test_10_mount_afp_share_on_osx_system SKIPPED [ 32%]
api2/afp.py::test_11_create_file_on_afp_share_via_osx_to_test_permissions SKIPPED [ 35%]
api2/afp.py::test_12_moving_afp_test_file_into_a_new_directory SKIPPED [ 38%]
api2/afp.py::test_13_deleting_test_file_and_directory_from_afp_share SKIPPED [ 41%]
api2/afp.py::test_14_verifying_test_file_directory_were_successfully_removed SKIPPED [ 45%]
api2/afp.py::test_15_unmount_afp_share SKIPPED [ 48%]
api2/afp.py::test_16_updating_the_apf_service PASSED [ 51%]
api2/afp.py::test_18_update_afp_share FAILED [ 54%]
api2/afp.py::test_19_checking_to_see_if_afp_service_is_enabled PASSED [ 58%]
api2/afp.py::test_16_mount_afp_share_on_osx_system SKIPPED [ 61%]
api2/afp.py::test_17_create_file_on_afp_share_via_osx_to_test_permissions SKIPPED [ 64%]
api2/afp.py::test_18_moving_afp_test_file_into_a_new_directory SKIPPED [ 67%]
api2/afp.py::test_19_deleting_test_file_and_directory_from_afp_share SKIPPED [ 70%]
api2/afp.py::test_20_verifying_test_file_directory_were_successfully_removed SKIPPED [ 74%]
api2/afp.py::test_21_unmount_afp_share SKIPPED [ 77%]
api2/afp.py::test_22_removing_SMB_mountpoint SKIPPED [ 80%]
api2/afp.py::test_28_delete_afp_share PASSED [ 83%]
api2/afp.py::test_25_stopping_afp_service PASSED [ 87%]
api2/afp.py::test_26_checking_if_afp_is_stop PASSED [ 90%]
api2/afp.py::test_23_disable_afp_service_at_boot PASSED [ 93%]
api2/afp.py::test_24_checking_afp_disable_at_boot PASSED [ 96%]
api2/afp.py::test_29_destroying_afp_dataset PASSED [100%]

------------- generated xml file: /usr/home/ericbsd/projects/freenas/freenas/tests/results/afp_tests_result.xml -------------- ========================================================== FAILURES ==========================================================
__________________________________________ test_18_update_afp_share __________________________________________

def test_18_update_afp_share():
afpid = GET(f'/sharing/afp?name={AFP_NAME}').json()[0]['id']
payload = {"home": True, "comment": "AFP Test"}
results = PUT(f"/sharing/afp/id/{afpid}", payload)

assert results.status_code 200, results.text

E AssertionError: <h1>500 Internal Server Error</h1><br><h2>Traceback:</h2>
E

Traceback (most recent call last):
E           File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 381, in start
E             resp = await self._request_handler(request)
E           File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 110, in __next__
E             return self.gen.send(None)
E           File "/usr/local/lib/python3.6/site-packages/aiohttp/web_app.py", line 322, in _handle
E             resp = await handler(request)
E           File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 110, in __next__
E             return self.gen.send(None)
E           File "/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 88, in impl
E             return await handler(request)
E           File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 110, in __next__
E             return self.gen.send(None)
E           File "/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 78, in impl
E             return await handler(request)
E           File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 110, in __next__
E             return self.gen.send(None)
E           File "/usr/local/lib/python3.6/site-packages/middlewared/restful.py", line 365, in on_method
E             return await do(method, req, resp, *args, **kwargs)
E           File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 110, in __next__
E             return self.gen.send(None)
E           File "/usr/local/lib/python3.6/site-packages/middlewared/restful.py", line 497, in do
E             result = await self.middleware.call(methodname, *method_args)
E           File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 110, in __next__
E             return self.gen.send(None)
E           File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1018, in call
E             return await self._call(name, serviceobj, methodobj, params, pipes=pipes)
E           File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 110, in __next__
E             return self.gen.send(None)
E           File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 953, in _call
E             return await methodobj(*args)
E           File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 110, in __next__
E             return self.gen.send(None)
E           File "/usr/local/lib/python3.6/site-packages/middlewared/service.py", line 274, in update
E             f'{self._config.namespace}.update', self, self.do_update, [id, data]
E           File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 110, in __next__
E             return self.gen.send(None)
E           File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 953, in _call
E             return await methodobj(*args)
E           File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 110, in __next__
E             return self.gen.send(None)
E           File "/usr/local/lib/python3.6/site-packages/middlewared/schema.py", line 646, in nf
E             return await f(*args, **kwargs)
E           File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 110, in __next__
E             return self.gen.send(None)
E           File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/afp.py", line 121, in do_update
E             path = data['path']
E         KeyError: 'path'
E         

E assert 500 200
E + where 500 = <Response [500]>.status_code

api2/afp.py:160: AssertionError ====================================== 1 failed, 16 passed, 14 skipped in 13.57 seconds ======================================

Associated revisions

Revision 2d5e1253 (diff)
Added by Brandon Schneider over 2 years ago

fix(afp): Path key may not exist Ticket: #34381

Revision ee15f1fa (diff)
Added by Brandon Schneider over 2 years ago

fix(afp): Path key may not exist (#1327) Ticket: #34381

History

#1 Updated by Dru Lavigne over 2 years ago

  • Assignee changed from Release Council to William Grzybowski

#2 Updated by William Grzybowski over 2 years ago

  • Assignee changed from William Grzybowski to Brandon Schneider
  • Target version changed from Backlog to 11.2-RC2
  • Severity changed from New to Medium
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#3 Updated by Brandon Schneider over 2 years ago

  • Status changed from Unscreened to In Progress

#4 Updated by Brandon Schneider over 2 years ago

#5 Updated by Brandon Schneider over 2 years ago

  • Status changed from In Progress to Ready for Testing

#6 Updated by Eric Turgeon over 2 years ago

  • Needs QA changed from Yes to No

It is now working.

#7 Updated by Dru Lavigne over 2 years ago

  • Subject changed from API 2.0 PUT /sharing/afp/id/{id} failed with 500 to Fix traceback in AFP share API
  • Status changed from Ready for Testing to Done
  • Target version changed from 11.2-RC2 to 11.2-BETA1

Also available in: Atom PDF