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

pybind/cephfs: fix missing terminating NULL char in readlink()'s C string #38367

Merged
merged 1 commit into from Dec 9, 2020
Merged

pybind/cephfs: fix missing terminating NULL char in readlink()'s C string #38367

merged 1 commit into from Dec 9, 2020

Conversation

tuan-hoang1
Copy link
Contributor

The error is in test_readlink() in src/test/pybind/test_cephfs.py:

...
test_cephfs.test_readlink ... FAIL

======================================================================
FAIL: test_cephfs.test_readlink
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/tmhoang/test_cephfs.py", line 99, in test_readlink
    assert_equal(d, b"/file-1")
AssertionError: b'/file-1\xe8' != b'/file-1'
...

Fixes: https://tracker.ceph.com/issues/48408

Signed-off-by: Tuan Hoang tmhoang@linux.ibm.com

@github-actions github-actions bot added cephfs Ceph File System pybind labels Dec 1, 2020
@tuan-hoang1
Copy link
Contributor Author

src/pybind/cephfs/cephfs.pyx Outdated Show resolved Hide resolved
src/pybind/cephfs/cephfs.pyx Outdated Show resolved Hide resolved
@tuan-hoang1
Copy link
Contributor Author

tuan-hoang1 commented Dec 2, 2020

Patrick's suggestion works on both Nautilus and Octopus.

@batrick
Copy link
Member

batrick commented Dec 2, 2020

206/212 Test #145: mgr-dashboard-frontend-unittests ..........***Failed  452.09 sec

> ceph-dashboard@0.0.0 build /home/jenkins-build/build/workspace/ceph-pull-requests/src/pybind/mgr/dashboard/frontend
> npm run env_build && ng build --configuration=$npm_package_config_locale "--prod" "--progress=false"


> ceph-dashboard@0.0.0 env_build /home/jenkins-build/build/workspace/ceph-pull-requests/src/pybind/mgr/dashboard/frontend
> node cd --env

[cd.js] 'src/environments/environment.tpl.ts' was copied to 'src/environments/environment.ts'
[cd.js] 'src/environments/environment.tpl.ts' was copied to 'src/environments/environment.prod.ts'
[cd.js] Placeholders were replace in 'src/environments/environment.ts'
[cd.js] Placeholders were replace in 'src/environments/environment.prod.ts'

chunk {} runtime.8c3a7252604330b672a5.js (runtime) 2.28 kB [entry] [rendered]
chunk {1} 1.f048543707b9f69207c5.js () 225 kB  [rendered]
chunk {2} main.e49bfc4b5ec5ad098a6d.css, main.d90f2d440a628c66b21b.js (main) 2.28 MB [initial] [rendered]
chunk {3} polyfills.b66d1515aae6fe3887b1.js (polyfills) 36 kB [initial] [rendered]
chunk {4} styles.d45c439314c20fc10229.css (styles) 210 kB [initial] [rendered]
chunk {5} 5.2127eb4192a17a78e08f.js () 96.6 kB  [rendered]
chunk {6} 6.71c0201f36f2e06ce22a.js () 110 kB  [rendered]
chunk {scripts} scripts.38cee5fbd56812617717.js (scripts) 205 kB [entry] [rendered]
Date: 2020-12-02T14:28:38.626Z - Hash: 916a333280d075c46bf4 - Time: 155407ms
Localized bundle generation complete.

> ceph-dashboard@0.0.0 test:ci /home/jenkins-build/build/workspace/ceph-pull-requests/src/pybind/mgr/dashboard/frontend
> jest --clearCache && JEST_SILENT_REPORTER_DOTS=true jest --coverage --reporters jest-silent-reporter

Cleared /tmp/jest_rt
.
  ● Test suite failed to run

    src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.spec.ts:7:30 - error TS2307: Cannot find module 'app/shared/components/select/select-option.model' or its corresponding type declarations.

    7 import { SelectOption } from 'app/shared/components/select/select-option.model';
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.
  ● Test suite failed to run

    src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.spec.ts:7:30 - error TS2307: Cannot find module 'app/shared/components/select/select-option.model' or its corresponding type declarations.

    7 import { SelectOption } from 'app/shared/components/select/select-option.model';
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.
  ● Test suite failed to run

    src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.spec.ts:7:30 - error TS2307: Cannot find module 'app/shared/components/select/select-option.model' or its corresponding type declarations.

    7 import { SelectOption } from 'app/shared/components/select/select-option.model';
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.
  ● Test suite failed to run

    src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.spec.ts:7:30 - error TS2307: Cannot find module 'app/shared/components/select/select-option.model' or its corresponding type declarations.

    7 import { SelectOption } from 'app/shared/components/select/select-option.model';
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.
  ● Test suite failed to run

    src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.spec.ts:7:30 - error TS2307: Cannot find module 'app/shared/components/select/select-option.model' or its corresponding type declarations.

    7 import { SelectOption } from 'app/shared/components/select/select-option.model';
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.
  ● Test suite failed to run

    src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.spec.ts:7:30 - error TS2307: Cannot find module 'app/shared/components/select/select-option.model' or its corresponding type declarations.

    7 import { SelectOption } from 'app/shared/components/select/select-option.model';
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.
  ● Test suite failed to run

    src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.spec.ts:7:30 - error TS2307: Cannot find module 'app/shared/components/select/select-option.model' or its corresponding type declarations.

    7 import { SelectOption } from 'app/shared/components/select/select-option.model';
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.................................................................................................................................................................................................................................................................................A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --runInBand --detectOpenHandles to find leaks.


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ceph-dashboard@0.0.0 test:ci: `jest --clearCache && JEST_SILENT_REPORTER_DOTS=true jest --coverage --reporters jest-silent-reporter`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ceph-dashboard@0.0.0 test:ci script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/jenkins-build/.npm/_logs/2020-12-02T14_31_03_930Z-debug.log

retrying...

@batrick
Copy link
Member

batrick commented Dec 2, 2020

jenkins test make check

@batrick
Copy link
Member

batrick commented Dec 2, 2020

jenkins test make check

@batrick
Copy link
Member

batrick commented Dec 3, 2020

jenkins test make check

@tuan-hoang1
Copy link
Contributor Author

I guess the Jenkins failure is not related to this PR. Please let me know if there is anything else I could do on my side. Thanks.

…ring

The error is in test_readlink() in src/test/pybind/test_cephfs.py:

...
test_cephfs.test_readlink ... FAIL

======================================================================
FAIL: test_cephfs.test_readlink
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/tmhoang/test_cephfs.py", line 99, in test_readlink
    assert_equal(d, b"/file-1")
AssertionError: b'/file-1\xe8' != b'/file-1'
...

Fixes: https://tracker.ceph.com/issues/48408

Signed-off-by: Tuan Hoang <tmhoang@linux.ibm.com>
@tuan-hoang1 tuan-hoang1 changed the title pybind/cephfs: missing terminating NULL char in buf string from readlink() pybind/cephfs: fix missing terminating NULL char in readlink()'s C string Dec 7, 2020
@tuan-hoang1
Copy link
Contributor Author

@tchaikov @batrick : I changed accordingly to your suggestions. Please review again, thanks!

@batrick
Copy link
Member

batrick commented Dec 9, 2020

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