~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to tests/df/total-verify.sh

  • Committer: Colin Watson
  • Date: 2013-10-30 15:48:33 UTC
  • mfrom: (8.3.5 sid)
  • Revision ID: cjwatson@canonical.com-20131030154833-xdt6e1yfffqom1c4
merge from Debian 8.21-1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
# Ensure "df --total" computes accurate totals
3
3
 
4
 
# Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
4
# Copyright (C) 2008-2013 Free Software Foundation, Inc.
5
5
 
6
6
# This program is free software: you can redistribute it and/or modify
7
7
# it under the terms of the GNU General Public License as published by
31
31
    # Recognize df output lines like these:
32
32
    # /dev/sdc1                  0       0       0    -  /c
33
33
    # tmpfs                1536000   12965 1523035    1% /tmp
34
 
    # total                5285932  787409 4498523   15%
35
 
    /^(.*?) +(-?\d+|-) +(-?\d+|-) +(-?\d+|-) +(?:- |[0-9]+%)(.*)$/
 
34
    # total                5285932  787409 4498523   15% -
 
35
    /^(.*?) +(-?\d+|-) +(-?\d+|-) +(-?\d+|-) +(?:-|[0-9]+%) (.*)$/
36
36
      or die "$0: invalid input line\n: $_";
37
 
    if ($1 eq 'total' && $5 eq '')
 
37
    if ($1 eq 'total' && $5 eq '-')
38
38
      {
39
39
        $total == $2 or die "$total != $2";
40
40
        $used  == $3 or die "$used  != $3";