Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

CORTX-30083:Fix Codacy issues under "net" directory #1936

Merged
merged 1 commit into from
Aug 29, 2022

Conversation

Vinoth2101
Copy link
Contributor

@Vinoth2101 Vinoth2101 commented Jun 26, 2022

CORTX-30083: Fix Codacy issues under "net" directory
- Fixing Codacy issues under net/test dir

Signed-off-by: Vinoth.V vinoth.v@seagate.com

Problem Statement

Codacy error :

  • "Double quote to prevent globing and words splitting".
  • variable unused. Verify use (or export if used externally).
  • %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'
  • Boolean result is used in bitwise operation. Clarify expression with parentheses.

Design

  • We are putting the variable references in double quotes.
  • Exported the variables as it is used in different shell scripts
  • modified appropriate format string
  • brackets applied , so the Boolean operation happens based on associativity

Coding

Checklist for Author

  • Coding conventions are followed and code is consistent

Testing

Checklist for Author

  • Unit and System Tests are added
  • Test Cases cover Happy Path, Non-Happy Path and Scalability
  • Testing was performed with RPM

Impact Analysis

Checklist for Author/Reviewer/GateKeeper

  • Interface change (if any) are documented
  • Side effects on other features (deployment/upgrade)
  • Dependencies on other component(s)

Review Checklist

Checklist for Author

  • JIRA number/GitHub Issue added to PR
  • PR is self reviewed
  • Jira and state/status is updated and JIRA is updated with PR link
  • Check if the description is clear and explained

Documentation

Checklist for Author

  • Changes done to WIKI / Confluence page / Quick Start Guide

Testing Result

Tested with debug message
<< 01net >>
transfer machines endpoint prefix is 0@lo:12345:42
------ test client in user space, test server in user space
--- ping test (test message size is 4KiB)
====CORTX-30083====
====CORTX-30083====
avg out: 20.1MiB/s avg in: 20.1MiB/s total out: 20.1MiB total in: 20.1MiB avg RTT: 1040.351 us
avg out: 19.5MiB/s avg in: 19.5MiB/s total out: 39.0MiB total in: 39.0MiB avg RTT: 1145.171 us
avg out: 18.7MiB/s avg in: 18.7MiB/s total out: 56.2MiB total in: 56.1MiB avg RTT: 1266.184 us
avg out: 18.9MiB/s avg in: 18.9MiB/s total out: 75.8MiB total in: 75.8MiB avg RTT: 1243.033 us
avg out: 19.5MiB/s avg in: 19.5MiB/s total out: 97.9MiB total in: 97.9MiB avg RTT: 1208.526 us
clients total: messages total/failed/bad: sent = 25070/0/0, received = 25065/0/0, bulk sent = 0/0/0, bulk received = 0/0/0, transfers = 25065/0/0; count/min/max/avg/stddev: MPS, sent = 5/4375/5639/5004/461, MPS, received = 5/4375/5636/5003/459, RTT = 25065/137221/8004746/1208479/588752 ns
servers total: messages total/failed/bad: sent = 25076/0/0, received = 25076/0/0, bulk sent = 0/0/0, bulk received = 0/0/0, transfers = 0/0/0; count/min/max/avg/stddev: MPS, sent = 5/4357/5626/5001/460, MPS, received = 5/4365/5628/5002/459, RTT = 0/0/0/0/0 ns
--- bulk test (test message size is 1MiB)
====CORTX-30083====
====CORTX-30083====
avg out: 0B /s avg in: 464MiB/s total out: 465MiB total in: 465MiB avg RTT: 17025.671 us
avg out: 476MiB/s avg in: 475MiB/s total out: 953MiB total in: 952MiB avg RTT: 16703.677 us
avg out: 463MiB/s avg in: 462MiB/s total out: 1.36GiB total in: 1.36GiB avg RTT: 17181.814 us
avg out: 461MiB/s avg in: 461MiB/s total out: 1.81GiB total in: 1.81GiB avg RTT: 17256.008 us
avg out: 467MiB/s avg in: 467MiB/s total out: 2.29GiB total in: 2.29GiB avg RTT: 17040.427 us
clients total: messages total/failed/bad: sent = 2349/0/0, received = 0/0/0, bulk sent = 2342/0/0, bulk received = 2341/0/0, transfers = 2341/0/0; count/min/max/avg/stddev: MPS, sent = 5/437/490/467/22, MPS, received = 5/437/491/467/22, RTT = 2341/11646241/42280479/17040427/3055819 ns
servers total: messages total/failed/bad: sent = 0/0/0, received = 2350/0/0, bulk sent = 2344/0/0, bulk received = 2344/0/0, transfers = 2344/0/0; count/min/max/avg/stddev: MPS, sent = 5/438/490/467/21, MPS, received = 5/437/490/466/23, RTT = 2344/7158514/34212564/15586631/3285192 ns
net: test status: SUCCESS
20.06user 11.23system 0:34.97elapsed 89%CPU (0avgtext+0avgdata 72008maxresident)k
8inputs+197384outputs (12major+134370minor)pagefaults 0swaps

@stale
Copy link

stale bot commented Jul 10, 2022

This issue/pull request has been marked as needs attention as it has been left pending without new activity for 4 days. Tagging @nkommuri @mehjoshi @huanghua78 for appropriate assignment. Sorry for the delay & Thank you for contributing to CORTX. We will get back to you as soon as possible.

@cortx-admin
Copy link

Can one of the admins verify this patch?

@stale stale bot removed the needs-attention label Jul 28, 2022
@hessio hessio added codacy Status: Waiting to be Reviewed PR is waiting for reviewers to review the PR labels Aug 9, 2022
@stale
Copy link

stale bot commented Aug 13, 2022

This issue/pull request has been marked as needs attention as it has been left pending without new activity for 4 days. Tagging @nkommuri @mehjoshi @huanghua78 for appropriate assignment. Sorry for the delay & Thank you for contributing to CORTX. We will get back to you as soon as possible.

@Vinoth2101 Vinoth2101 force-pushed the CORTX-30083-net2 branch 4 times, most recently from 528c652 to 2c4289a Compare August 24, 2022 05:55
@Vinoth2101 Vinoth2101 force-pushed the CORTX-30083-net2 branch 2 times, most recently from 7e79538 to 05ec4e5 Compare August 26, 2022 05:02
@rkothiya
Copy link
Contributor

Jenkins CI Result : Motr#1642

Motr Test Summary

Test ResultCountInfo
❌Failed2
📁

04motr-single-node/49motr-rpc-cancel
01motr-single-node/00userspace-tests

🏁Skipped32
📁

01motr-single-node/28sys-kvs
01motr-single-node/35m0singlenode
01motr-single-node/04initscripts
01motr-single-node/37protocol
02motr-single-node/51kem
02motr-single-node/20rpc-session-cancel
02motr-single-node/10pver-assign
02motr-single-node/21fsync-single-node
02motr-single-node/13dgmode-io
02motr-single-node/14poolmach
02motr-single-node/11m0t1fs
02motr-single-node/26motr-user-kernel-tests
02motr-single-node/08spiel
03motr-single-node/06conf
03motr-single-node/36spare-reservation
04motr-single-node/34sns-repair-1n-1f
04motr-single-node/08spiel-sns-repair-quiesce
04motr-single-node/28sys-kvs-kernel
04motr-single-node/11m0t1fs-rconfc-fail
04motr-single-node/08spiel-sns-repair
04motr-single-node/19sns-repair-abort
04motr-single-node/22sns-repair-ios-fail
05motr-single-node/18sns-repair-quiesce
05motr-single-node/12fwait
05motr-single-node/16sns-repair-multi
05motr-single-node/07mount-fail
05motr-single-node/15sns-repair-single
05motr-single-node/23sns-abort-quiesce
05motr-single-node/17sns-repair-concurrent-io
05motr-single-node/07mount
05motr-single-node/07mount-multiple
05motr-single-node/12fsync

✔️Passed43
📁

01motr-single-node/43m0crate
01motr-single-node/05confgen
01motr-single-node/06hagen
01motr-single-node/52motr-singlenode-sanity
01motr-single-node/01net
01motr-single-node/01kernel-tests
01motr-single-node/03console
01motr-single-node/02rpcping
02motr-single-node/07m0d-fatal
02motr-single-node/67fdmi-plugin-multi-filters
02motr-single-node/53clusterusage-alert
02motr-single-node/41motr-conf-update
03motr-single-node/61sns-repair-motr-1n-1f
03motr-single-node/72spiel-sns-motr-repair-quiesce
03motr-single-node/08spiel-multi-confd
03motr-single-node/69sns-repair-motr-quiesce
03motr-single-node/62sns-repair-motr-mf
03motr-single-node/70sns-failure-after-repair-quiesce
03motr-single-node/63sns-repair-motr-1k-1f
03motr-single-node/60sns-repair-motr-1f
03motr-single-node/66sns-repair-motr-abort-quiesce
03motr-single-node/24motr-dix-repair-lookup-insert-spiel
03motr-single-node/68sns-repair-motr-shutdown
03motr-single-node/64sns-repair-motr-ios-fail
03motr-single-node/71spiel-sns-motr-repair
03motr-single-node/24motr-dix-repair-lookup-insert-m0repair
03motr-single-node/04sss
03motr-single-node/65sns-repair-motr-abort
04motr-single-node/73motr-io-small-disks
04motr-single-node/48motr-raid0-io
04motr-single-node/74motr-di-corruption-detection
04motr-single-node/25m0kv
04motr-single-node/44motr-rm-lock-cc-io
04motr-single-node/45motr-rmw
05motr-single-node/23dix-repair-m0repair
05motr-single-node/43motr-sync-replication
05motr-single-node/42motr-utils
05motr-single-node/45motr-sns-repair-N-1
05motr-single-node/40motr-dgmode
05motr-single-node/23dix-repair-quiesce-m0repair
05motr-single-node/23spiel-dix-repair-quiesce
05motr-single-node/44motr-sns-repair
05motr-single-node/23spiel-dix-repair

Total77🔗

CppCheck Summary

   Cppcheck: No new warnings found 👍

    This patch fixes some of the codacy warnings in "net" dir.

Signed-off-by: Vinoth.V <vinoth.v@seagate.com>
@rkothiya
Copy link
Contributor

Currently Memory leak pre-merge job is failing for all the pr's and hence we are ignoring it, as we do not want to block merge. Once we streamline that we will mandate its passing.

@rkothiya rkothiya merged commit 183d952 into Seagate:main Aug 29, 2022
@rkothiya rkothiya added Exception Allowed to merge without runing ut and st and removed Status: Waiting to be Reviewed PR is waiting for reviewers to review the PR review required labels Aug 29, 2022
kiwionly2 pushed a commit to kiwionly2/cortx-motr that referenced this pull request Aug 30, 2022
Problem:

Getting following Codacy Warnings: 
Double quote to prevent globing and words splitting.
variable unused. Verify use (or export if used externally).
%d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'
Boolean result is used in bitwise operation. Clarify expression with parentheses.

Solution:

We are putting the variable references in double quotes.
Exported the variables as it is used in different shell scripts
modified appropriate format string
brackets applied , so the Boolean operation happens based on associativity
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
cla-signed codacy Exception Allowed to merge without runing ut and st
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants