Project

General

Profile

Bug #34528

Fix traceback in /sharing/cifs/id API

Added by Eric Turgeon 5 months ago. Updated 5 months ago.

Status:
Done
Priority:
No priority
Assignee:
Brandon Schneider
Category:
Middleware
Target version:
Sprint:
Severity:
Medium
Backlog Priority:
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

The PUT /sharing/cifs/id/{id} does not seems to work properly.

==================================================== 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 50 items                                                                                                           

api2/smb_and_cifs.py::test_01_setting_auxilary_parameters_for_mount_smbfs PASSED                                       [  2%]
api2/smb_and_cifs.py::test_02_creating_smb_dataset PASSED                                                              [  4%]
api2/smb_and_cifs.py::test_03_changing_permissions_on_smb_PATH PASSED                                                  [  6%]
api2/smb_and_cifs.py::test_04_starting_cifs_service_at_boot PASSED                                                     [  8%]
api2/smb_and_cifs.py::test_05_checking_to_see_if_clif_service_is_enabled_at_boot PASSED                                [ 10%]
api2/smb_and_cifs.py::test_06_starting_cifs_service PASSED                                                             [ 12%]
api2/smb_and_cifs.py::test_07_checking_to_see_if_nfs_service_is_running PASSED                                         [ 14%]
api2/smb_and_cifs.py::test_08_Creating_a_cifs_share_on_smb_PATH PASSED                                                 [ 16%]
api2/smb_and_cifs.py::test_09_creating_smb_mountpoint_on_bsd SKIPPED                                                   [ 18%]
api2/smb_and_cifs.py::test_10_mounting_smb_on_bsd SKIPPED                                                              [ 20%]
api2/smb_and_cifs.py::test_11_creating_smb_file_on_bsd SKIPPED                                                         [ 22%]
api2/smb_and_cifs.py::test_12_moving_smb_file_on_bsd SKIPPED                                                           [ 24%]
api2/smb_and_cifs.py::test_13_copying_smb_file_on_bsd SKIPPED                                                          [ 26%]
api2/smb_and_cifs.py::test_14_deleting_smb_file_1_2_on_bsd SKIPPED                                                     [ 28%]
api2/smb_and_cifs.py::test_15_deleting_smb_file_2_2_on_bsd SKIPPED                                                     [ 30%]
api2/smb_and_cifs.py::test_16_unmounting_smb_on_bsd SKIPPED                                                            [ 32%]
api2/smb_and_cifs.py::test_17_mounting_smb_on_bsd SKIPPED                                                              [ 34%]
api2/smb_and_cifs.py::test_18_creating_smb_file_on_bsd SKIPPED                                                         [ 36%]
api2/smb_and_cifs.py::test_19_moving_smb_file_on_bsd SKIPPED                                                           [ 38%]
api2/smb_and_cifs.py::test_20_copying_smb_file_on_bsd SKIPPED                                                          [ 40%]
api2/smb_and_cifs.py::test_21_deleting_smb_file_1_2_on_bsd SKIPPED                                                     [ 42%]
api2/smb_and_cifs.py::test_22_deleting_smb_file_2_2_on_bsd SKIPPED                                                     [ 44%]
api2/smb_and_cifs.py::test_23_unmounting_smb_on_bsd SKIPPED                                                            [ 46%]
api2/smb_and_cifs.py::test_24_removing_smb_mountpoint_on_bsd SKIPPED                                                   [ 48%]
api2/smb_and_cifs.py::test_25_stoping_clif_service PASSED                                                              [ 50%]
api2/smb_and_cifs.py::test_26_checking_if_cifs_is_stop PASSED                                                          [ 52%]
api2/smb_and_cifs.py::test_27_update_smb PASSED                                                                        [ 54%]
api2/smb_and_cifs.py::test_28_update_cifs_share FAILED                                                                 [ 56%]
api2/smb_and_cifs.py::test_29_starting_cifs_service PASSED                                                             [ 58%]
api2/smb_and_cifs.py::test_30_checking_to_see_if_nfs_service_is_running PASSED                                         [ 60%]
api2/smb_and_cifs.py::test_31_create_mount_point_for_smb_on_osx SKIPPED                                                [ 62%]
api2/smb_and_cifs.py::test_32_mount_smb_share_on_osx SKIPPED                                                           [ 64%]
api2/smb_and_cifs.py::test_33_create_file_on_smb_share_via_osx_to_test_permissions SKIPPED                             [ 66%]
api2/smb_and_cifs.py::test_34_moving_smb_test_file_into_a_new_directory_on_osx SKIPPED                                 [ 68%]
api2/smb_and_cifs.py::test_35_deleting_test_file_and_directory_from_smb_share_on_osx SKIPPED                           [ 70%]
api2/smb_and_cifs.py::test_36_verifying_test_file_directory_were_successfully_removed_on_osx SKIPPED                   [ 72%]
api2/smb_and_cifs.py::test_37_unmount_smb_share_on_osx SKIPPED                                                         [ 74%]
api2/smb_and_cifs.py::test_38_mount_smb_share_on_osx SKIPPED                                                           [ 76%]
api2/smb_and_cifs.py::test_39_create_file_on_smb_share_via_osx_to_test_permissions_on_osx SKIPPED                      [ 78%]
api2/smb_and_cifs.py::test_40_moving_smb_test_file_into_a_new_directory_on_osx SKIPPED                                 [ 80%]
api2/smb_and_cifs.py::test_41_deleting_test_file_and_directory_from_smb_share_on_osx SKIPPED                           [ 82%]
api2/smb_and_cifs.py::test_42_verifying_test_file_directory_were_successfully_removed_on_osx SKIPPED                   [ 84%]
api2/smb_and_cifs.py::test_43_Unmount_smb_share_on_osx SKIPPED                                                         [ 86%]
api2/smb_and_cifs.py::test_44_Removing_smb_mountpoint_on_osx SKIPPED                                                   [ 88%]
api2/smb_and_cifs.py::test_45_delete_cifs_share PASSED                                                                 [ 90%]
api2/smb_and_cifs.py::test_46_disable_cifs_service_at_boot PASSED                                                      [ 92%]
api2/smb_and_cifs.py::test_47_checking_to_see_if_clif_service_is_enabled_at_boot PASSED                                [ 94%]
api2/smb_and_cifs.py::test_48_stoping_clif_service PASSED                                                              [ 96%]
api2/smb_and_cifs.py::test_49_checking_if_cifs_is_stop PASSED                                                          [ 98%]
api2/smb_and_cifs.py::test_50_destroying_smb_dataset PASSED                                                            [100%]

--------- generated xml file: /usr/home/ericbsd/projects/freenas/freenas/tests/results/smb_and_cifs_tests_result.xml ---------
========================================================== FAILURES ==========================================================
_________________________________________________ test_28_update_cifs_share __________________________________________________

    def test_28_update_cifs_share():
        cifsid = GET(f'/sharing/cifs?name={SMB_NAME}').json()[0]['id']
        results = PUT(f"/sharing/cifs/id/{cifsid}", {"home": False})
>       assert results.status_code == 200, results.text
E       AssertionError: <h1>500 Internal Server Error</h1><br><h2>Traceback:</h2>
E         &lt;pre&gt;Traceback (most recent call last):
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py&amp;quot;, line 381, in start
E             resp = await self._request_handler(request)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/aiohttp/web_app.py&amp;quot;, line 322, in _handle
E             resp = await handler(request)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py&amp;quot;, line 88, in impl
E             return await handler(request)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py&amp;quot;, line 78, in impl
E             return await handler(request)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/middlewared/restful.py&amp;quot;, line 365, in on_method
E             return await do(method, req, resp, *args, **kwargs)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/middlewared/restful.py&amp;quot;, line 497, in do
E             result = await self.middleware.call(methodname, *method_args)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/middlewared/main.py&amp;quot;, line 1018, in call
E             return await self._call(name, serviceobj, methodobj, params, pipes=pipes)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/middlewared/main.py&amp;quot;, line 953, in _call
E             return await methodobj(*args)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/middlewared/service.py&amp;quot;, line 274, in update
E             f&amp;#x27;{self._config.namespace}.update&amp;#x27;, self, self.do_update, [id, data]
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/middlewared/main.py&amp;quot;, line 953, in _call
E             return await methodobj(*args)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/middlewared/schema.py&amp;quot;, line 646, in nf
E             return await f(*args, **kwargs)
E           File &amp;quot;/usr/local/lib/python3.6/asyncio/coroutines.py&amp;quot;, line 110, in __next__
E             return self.gen.send(None)
E           File &amp;quot;/usr/local/lib/python3.6/site-packages/middlewared/plugins/smb.py&amp;quot;, line 190, in do_update
E             path = data[&amp;#x27;path&amp;#x27;]
E         KeyError: &amp;#x27;path&amp;#x27;
E         &lt;/pre&gt;
E       assert 500 == 200
E        +  where 500 = &lt;Response [500]&gt;.status_code

api2/smb_and_cifs.py:254: AssertionError
====================================== 1 failed, 19 passed, 30 skipped in 34.41 seconds ======================================

Associated revisions

Revision d3cc6b62 (diff)
Added by Brandon Schneider 5 months ago

fix(plugin/smb): Path key may not exist

Ticket: #34528

Revision 2aabd381 (diff)
Added by Brandon Schneider 5 months ago

fix(plugin/smb): Path key may not exist

Ticket: #34528

Revision 3252e900 (diff)
Added by Brandon Schneider 5 months ago

fix(plugin/smb): Path key may not exist (#1361)

Ticket: #34528

Revision a282364a (diff)
Added by Brandon Schneider 5 months ago

fix(plugin/smb): Path key may not exist (#1361)

Ticket: #34528

History

#1 Updated by Dru Lavigne 5 months ago

  • Assignee changed from Release Council to William Grzybowski

#2 Updated by William Grzybowski 5 months ago

  • Assignee changed from William Grzybowski to Brandon Schneider
  • Target version changed from Backlog to 11.2-RC2
  • Severity changed from New to Medium

#3 Updated by Brandon Schneider 5 months ago

  • Status changed from Unscreened to Not Started

#4 Updated by Brandon Schneider 5 months ago

  • Status changed from Not Started to In Progress

#5 Updated by Brandon Schneider 5 months ago

  • Status changed from In Progress to Ready for Testing

#6 Updated by Dru Lavigne 5 months ago

  • Subject changed from API 2.0 PUT /sharing/cifs/id/{id} failed with 500 to Fix traceback in /sharing/cifs/id API
  • Target version changed from 11.2-RC2 to 11.2-BETA1
  • Needs Merging changed from Yes to No

#7 Updated by Eric Turgeon 5 months ago

  • Needs QA changed from Yes to No

it is fix

#8 Updated by Dru Lavigne 5 months ago

  • Status changed from Ready for Testing to Done

Also available in: Atom PDF