max_diskspace_used script has syntax error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
checkbox (Ubuntu) |
Fix Released
|
High
|
Marc Tardif |
Bug Description
Steps to reproduce:
from trunk:
cd scripts/
./max_diskspace
Result:
Checking maximum disk space available on : /dev/sda1
awk: //dev/sda1/ {print $3}
awk: ^ syntax error
Expected result:
Not a syntax error :)
there's an awk command that looks like:
awk /$disk/ {print $3}
the problem is that $disk may contain forward slashes, so the regex ends up malformed. Not sure how to fix this, but here's the bug report anyway.
Thanks!
ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: checkbox (not installed)
ProcVersionSign
Uname: Linux 3.0.0-15-generic x86_64
NonfreeKernelMo
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
Date: Fri Feb 3 15:10:18 2012
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
ProcEnviron:
LANGUAGE=en_CA:en
PATH=(custom, user)
LANG=en_CA.UTF-8
SHELL=/bin/bash
SourcePackage: checkbox
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
- Jeff Lane : Approve
- Marc Tardif (community): Needs Resubmitting
-
Diff: 55 lines (+18/-8) (has conflicts)2 files modifieddebian/changelog (+5/-0)
scripts/max_diskspace_used (+13/-8)
- Mathieu Trudel-Lapierre: Approve
- Daniel Manrique (community): Needs Resubmitting
- Ubuntu branches: Pending requested
-
Diff: 23486 lines (+14509/-942)165 files modifiedbin/checkbox-qt (+26/-0)
checkbox/job.py (+2/-2)
checkbox/message.py (+17/-1)
checkbox/parsers/description.py (+74/-0)
checkbox/parsers/tests/cputable.py (+74/-0)
checkbox/parsers/tests/description.py (+146/-0)
checkbox/parsers/tests/dmi.py (+80/-0)
checkbox/parsers/tests/dmidecode.py (+60/-0)
checkbox/parsers/tests/udevadm.py (+68/-0)
checkbox/parsers/udevadm.py (+5/-1)
checkbox/user_interface.py (+7/-6)
checkbox_cli/cli_interface.py (+4/-7)
checkbox_gtk/gtk_interface.py (+10/-7)
checkbox_qt/qt_interface.py (+220/-0)
checkbox_urwid/urwid_interface.py (+12/-10)
data/whitelists/default.whitelist (+2/-10)
debian/changelog (+73/-0)
debian/checkbox-gtk.install (+1/-1)
debian/checkbox-qt.install (+6/-0)
debian/checkbox-qt.links (+1/-0)
debian/checkbox-qt.postinst (+7/-0)
debian/control (+10/-1)
debian/po/de.po (+3/-4)
debian/po/en_AU.po (+3/-4)
debian/po/en_GB.po (+3/-4)
debian/po/es.po (+5/-5)
debian/po/fr.po (+3/-4)
debian/po/he.po (+3/-4)
debian/po/hu.po (+3/-4)
debian/po/it.po (+3/-4)
debian/po/ja.po (+6/-10)
debian/po/nl.po (+3/-4)
debian/po/pl.po (+3/-4)
debian/po/pt_BR.po (+3/-4)
debian/po/ro.po (+3/-4)
debian/po/ru.po (+3/-4)
debian/po/uk.po (+3/-4)
debian/po/zh_TW.po (+4/-7)
debian/rules (+7/-1)
examples/checkbox-qt.ini (+16/-0)
jobs/disk.txt.in (+19/-5)
jobs/graphics.txt.in (+1/-1)
jobs/mediacard.txt.in (+32/-44)
jobs/miscellanea.txt.in (+11/-11)
jobs/networking.txt.in (+1/-0)
jobs/optical.txt.in (+37/-34)
jobs/resource.txt.in (+5/-0)
plugins/jobs_info.py (+34/-6)
plugins/launchpad_prompt.py (+6/-5)
plugins/launchpad_report.py (+14/-1)
plugins/message_info.py (+19/-0)
plugins/suites_prompt.py (+17/-15)
plugins/user_interface.py (+6/-0)
po/ace.po (+2/-2)
po/af.po (+2/-2)
po/am.po (+2/-2)
po/ar.po (+2/-2)
po/ast.po (+1181/-48)
po/az.po (+2992/-0)
po/be.po (+2/-2)
po/bg.po (+2/-2)
po/bn.po (+2/-2)
po/bo.po (+2/-2)
po/br.po (+2/-2)
po/bs.po (+2/-2)
po/ca.po (+2/-2)
po/ca@valencia.po (+2/-2)
po/ckb.po (+79/-79)
po/cs.po (+2/-2)
po/cy.po (+2/-2)
po/da.po (+2/-2)
po/de.po (+269/-45)
po/dv.po (+2/-2)
po/el.po (+142/-6)
po/en_AU.po (+12/-2)
po/en_CA.po (+2/-2)
po/en_GB.po (+2/-2)
po/eo.po (+2/-2)
po/es.po (+473/-20)
po/et.po (+2/-2)
po/eu.po (+2/-2)
po/fa.po (+2/-2)
po/fi.po (+910/-54)
po/fr.po (+2/-2)
po/ga.po (+2/-2)
po/gd.po (+46/-16)
po/gl.po (+2/-2)
po/he.po (+2/-2)
po/hi.po (+2/-2)
po/hr.po (+2/-2)
po/hu.po (+2/-2)
po/hy.po (+2/-2)
po/id.po (+2/-2)
po/is.po (+2/-2)
po/it.po (+2/-2)
po/ja.po (+5/-4)
po/jbo.po (+2/-2)
po/ka.po (+2/-2)
po/kk.po (+2/-2)
po/km.po (+2/-2)
po/kn.po (+2/-2)
po/ko.po (+128/-6)
po/ku.po (+2/-2)
po/ky.po (+2/-2)
po/lt.po (+2/-2)
po/lv.po (+2/-2)
po/mk.po (+2/-2)
po/ml.po (+2/-2)
po/mr.po (+2/-2)
po/ms.po (+124/-75)
po/my.po (+2/-2)
po/nb.po (+2/-2)
po/nds.po (+2/-2)
po/ne.po (+2/-2)
po/nl.po (+2/-2)
po/nn.po (+2/-2)
po/oc.po (+13/-2)
po/pl.po (+2/-2)
po/ps.po (+2/-2)
po/pt.po (+2/-2)
po/pt_BR.po (+2/-2)
po/ro.po (+2/-2)
po/ru.po (+42/-8)
po/shn.po (+2/-2)
po/si.po (+2/-2)
po/sk.po (+176/-74)
po/sl.po (+372/-24)
po/sq.po (+2/-2)
po/sr.po (+2/-2)
po/sv.po (+3/-3)
po/ta.po (+2/-2)
po/te.po (+2/-2)
po/th.po (+2/-2)
po/tr.po (+3/-3)
po/ug.po (+4/-4)
po/uk.po (+2/-2)
po/ur.po (+2/-2)
po/uz.po (+2/-2)
po/vi.po (+2/-2)
po/zh_CN.po (+2/-2)
po/zh_HK.po (+2/-2)
po/zh_TW.po (+108/-74)
qt/checkbox-qt.desktop.in (+11/-0)
qt/checkbox-qt.ui (+935/-0)
qt/checkbox.svg (+2478/-0)
qt/com.canonical.QtCheckbox.service (+3/-0)
qt/frontend/frontend.pro (+25/-0)
qt/frontend/main.cpp (+14/-0)
qt/frontend/qrc_resources.cpp (+603/-0)
qt/frontend/qtfront.cpp (+491/-0)
qt/frontend/qtfront.h (+100/-0)
qt/frontend/qtfront.ui (+1029/-0)
qt/frontend/resources.qrc (+5/-0)
qt/frontend/step.cpp (+52/-0)
qt/frontend/step.h (+13/-0)
qt/frontend/treemodel.cpp (+83/-0)
qt/frontend/treemodel.h (+18/-0)
scripts/create_connection (+1/-1)
scripts/disk_stats_test (+71/-0)
scripts/max_diskspace_used (+13/-8)
scripts/memory_compare (+4/-2)
scripts/optical_write_test (+108/-0)
scripts/virt_check (+43/-0)
setup.cfg (+1/-1)
setup.py (+4/-2)
Changed in checkbox (Ubuntu): | |
importance: | Undecided → High |
status: | New → In Progress |
assignee: | nobody → Marc Tardif (cr3) |
Changed in checkbox (Ubuntu): | |
status: | In Progress → Fix Released |
I merged the linked branch and reran it and I get some more errors :(
sudo scripts/ max_diskspace_ used /dev/sda
[sudo] password for roadmr:
Checking maximum disk space available on : /dev/sda
Disk space available : 640GB
Disk space used : 479GB
62GB
awk: cmd. line:1: BEGIN{print((640 - 479
awk: cmd. line:1: ^ unexpected newline or end of string
awk: cmd. line:1: 62) / 479
awk: cmd. line:1: ^ syntax error
awk: cmd. line:1: 62) / 479
awk: cmd. line:1: ^ unterminated regexp
awk: cmd. line:2: 62)}
awk: cmd. line:2: ^ syntax error
Difference ( > 0.15 fails ) :
awk: BEGIN{exit( > 0.15)}
awk: ^ syntax error
awk: BEGIN{exit( > 0.15)}
awk: ^ syntax error
This is due to my having two partitions on SDA, thus this is what's confusing the script now:
Disk space available : 640GB
Disk space used : 479GB
62GB
Notice the extra CRLF and usage data for the second partition.
A simplistic fix is to head -1 the $fsize variable, but in this case it'd fail the test because the space for the second partition is not considered. I fail the test anyway because my disk is full of crap, but the weird handling of partitions is worrisome.