Change in vdsm[master]: contrib: add useful shell functions to assist in vdsm develo...

ibarkan at redhat.com ibarkan at redhat.com
Wed Jan 7 07:40:35 UTC 2015


Ido Barkan has posted comments on this change.

Change subject: contrib: add useful shell functions to assist in vdsm development
......................................................................


Patch Set 3:

(11 comments)

http://gerrit.ovirt.org/#/c/36344/3/contrib/zshrc
File contrib/zshrc:

Line 9:         sudo vdsClient 0 getVdsCaps | less
Line 10:     else
Line 11:         sudo vdsClient 0 getVdsCaps
Line 12:     fi
Line 13: }
> There is no reason to work with non-secure transport, I would make the defa
Done
Line 14: 
Line 15: scaps() {
Line 16:     if [ -t 1 ]; then
Line 17:         sudo vdsClient -s 0 getVdsCaps | less


Line 30:     vdsm_functional testSetupNetworksAddBondWithManyVlans
Line 31: }
Line 32: 
Line 33: vdsm_remove() {
Line 34:     sudo yum erase -y `rpm -qa | grep vdsm | perl -pe 's|-[0-9].*||' | paste -sd " "` && \
> Why not:
remove and erase are the same in yum. vdsm\* works fine.
Line 35:     git clean -fdx
Line 36: }
Line 37: 
Line 38: vdsm_install() {


Line 31: }
Line 32: 
Line 33: vdsm_remove() {
Line 34:     sudo yum erase -y `rpm -qa | grep vdsm | perl -pe 's|-[0-9].*||' | paste -sd " "` && \
Line 35:     git clean -fdx
> cd would help
Done
Line 36: }
Line 37: 
Line 38: vdsm_install() {
Line 39:     VERSION=`ls ~/rpmbuild/RPMS/x86_64/ -t -w 1 | head -1 | perl -pe 's|^.*?git|git|' | perl -pe 's|\..*$||'`


Line 37: 
Line 38: vdsm_install() {
Line 39:     VERSION=`ls ~/rpmbuild/RPMS/x86_64/ -t -w 1 | head -1 | perl -pe 's|^.*?git|git|' | perl -pe 's|\..*$||'`
Line 40:     FILES=`find ~/rpmbuild/RPMS/ -iname "*$VERSION*.rpm" | egrep "vdsm-[0-9]|python|cli|xmlrpc|jsonrpc|tests|infra"`
Line 41:     sudo yum install -y `echo $FILES | paste -sd " "`
> Install usually requires remove, because newer git builds are sometimes old
I will currently add vdsm_configure_force wherever needed
Line 42: }
Line 43: 
Line 44: vdsm_reinstall() {
Line 45:     VERSION=`ls ~/rpmbuild/RPMS/x86_64/ -t -w 1 | head -1 | perl -pe 's|^.*?git|git|' | perl -pe 's|\..*$||'`


Line 82: del_dummies() {
Line 83:     for nic in `ip l | awk '{print $2;}' | egrep "^dummy"`; do
Line 84:         sudo ip link del dev ${nic[0,-2]}
Line 85:     done
Line 86:     sudo rm /etc/sysconfig/network-scripts/ifcfg-dummy*
> * without \
Done
Line 87: }
Line 88: 
Line 89: del_bonds() {
Line 90:     for nic in `ip l | awk '{print $2;}' | egrep "^bond"`; do


Line 89: del_bonds() {
Line 90:     for nic in `ip l | awk '{print $2;}' | egrep "^bond"`; do
Line 91:         sudo echo "-${nic[0,-2]} "> /sys/class/net/bonding_masters
Line 92:     done
Line 93:     sudo rm /etc/sysconfig/network-scripts/ifcfg-bond\*
> * with \
it is
Line 94: }
Line 95: 
Line 96: del_bridges() {
Line 97:     for bridge in `brctl show | awk '{print $1;}' | grep test-network`; do


Line 151: }
Line 152: 
Line 153: vdsm_pep8() {
Line 154:     PEP8_BLACKLIST=config.py,constants.py,crossImportsTests.py,vdsm.py
Line 155:     /usr/bin/pep8 --exclude=$PEP8_BLACKLIST --filename '*.py,*.py.in' .
> would be better with cd ~/code/vdsm, like vdsm_unit()
Done
Line 156: }
Line 157: 
Line 158: vdsm_unit () {
Line 159:     cd ~/code/vdsm && \


Line 152: 
Line 153: vdsm_pep8() {
Line 154:     PEP8_BLACKLIST=config.py,constants.py,crossImportsTests.py,vdsm.py
Line 155:     /usr/bin/pep8 --exclude=$PEP8_BLACKLIST --filename '*.py,*.py.in' .
Line 156: }
> You can use "make pep8" instead
Done
Line 157: 
Line 158: vdsm_unit () {
Line 159:     cd ~/code/vdsm && \
Line 160:     ./autogen.sh --system && make && \


Line 155:     /usr/bin/pep8 --exclude=$PEP8_BLACKLIST --filename '*.py,*.py.in' .
Line 156: }
Line 157: 
Line 158: vdsm_unit () {
Line 159:     cd ~/code/vdsm && \
> vdsm folder could be stored in an variable
Done
Line 160:     ./autogen.sh --system && make && \
Line 161:     cd tests && sudo ./run_tests_local.sh $1
Line 162: }
Line 163: 


Line 158: vdsm_unit () {
Line 159:     cd ~/code/vdsm && \
Line 160:     ./autogen.sh --system && make && \
Line 161:     cd tests && sudo ./run_tests_local.sh $1
Line 162: }
> Why run unittests with sudo?
you have a point, but I prefer not to deal with it now. But it's a good idea to add a vdsm_check which runs unit tests without sudo
Line 163: 
Line 164: logs () {
Line 165:     less /var/log/vdsm/vdsm.log
Line 166: }


Line 166: }
Line 167: 
Line 168: super_logs () {
Line 169:     less /var/log/vdsm/supervdsm.log
Line 170: }
> I'm looking also in /var/log/messages and /var/log/sanlock, so we need some
Done


-- 
To view, visit http://gerrit.ovirt.org/36344
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ide4131db838640a5836fd029696849bced267308
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <toni at midokura.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list