summaryrefslogtreecommitdiffstats
path: root/regressions/rhbz557655.sh
Commit message (Collapse)AuthorAgeFilesLines
* tests: Split regressions -> various subdirectories of tests/Richard W.M. Jones2011-12-221-86/+0
|
* Update FSF address.Matthew Booth2011-11-081-1/+1
|
* regressions: Fix rhbz557655.sh so it works with tracing enabled.Richard W.M. Jones2011-02-031-0/+1
|
* fish: Allow suffixes on number parameters (eg. 1M)Richard Jones2010-05-211-4/+2
| | | | | | | | | | | | | | | | This small change uses the gnulib xstrtoll functionality to enable suffixes on integer parameters in guestfish. For example: truncate-size /file 1G (previously you would have had to given the full number). This also applies to the 'alloc' and 'sparse' commands (and indirectly to the -N option). The specification for these commands has changed slightly, in that 'alloc foo 1MB' would now use SI units, allocating 1000000 bytes instead of a true megabyte. All existing uses would use 'alloc foo 1M' which still allocates true megabytes.
* fish: Add -N option for making prepared disk images.Richard Jones2010-04-221-7/+1
| | | | | | | | | | | | | | | | | Previously you might have typed: $ guestfish ><fs> alloc test1.img 100M ><fs> run ><fs> part-disk /dev/sda mbr ><fs> mkfs ext4 /dev/sda1 now you can do the same with: $ guestfish -N fs:ext4 Some tests have also been updated to use this new functionality.
* Fix regressions/rhbz557655.sh when debugging is enabled (v2).Richard Jones2010-01-291-6/+15
| | | | | | | | The previous fix didn't cope with ordinary warnings emitted by qemu (eg. "open /dev/kvm: No such file or directory"). This is a hopefully more complete fix for the problem. See also commit 3cd7ce75f1ce5048a4d9f6aeaf66aff3194e1096.
* Fix regressions/rhbz557655.sh when debugging is enabled.Richard Jones2010-01-281-0/+1
| | | | | | | | | | | | The regression test for RHBZ#557655 would fail if debugging was enabled, because debug output would get mixed up with the test output. To reproduce the error do: LIBGUESTFS_DEBUG=1 make -C regressions TESTS=rhbz557655.sh check This commit disables debug for just this test.
* guestfish: Use xstrtol to parse integers (RHBZ#557655).Richard Jones2010-01-251-0/+83
Current code uses atoi to parse the generator Int type and atoll to parse the generator Int64 type. The problem with the ato* functions is that they don't cope with errors very well, and they cannot parse numbers that begin with 0.. or 0x.. for octal and hexadecimal respectively. This replaces the atoi call with a call to Gnulib xstrtol and the atoll call with a call to Gnulib xstrtoll. The generated code looks like this for all Int arguments: { strtol_error xerr; long r; xerr = xstrtol (argv[0], NULL, 0, &r, ""); if (xerr != LONGINT_OK) { fprintf (stderr, _("%s: %s: invalid integer parameter (%s returned %d)\n"), cmd, "memsize", "xstrtol", xerr); return -1; } /* The Int type in the generator is a signed 31 bit int. */ if (r < (-(2LL<<30)) || r > ((2LL<<30)-1)) { fprintf (stderr, _("%s: %s: integer out of range\n"), cmd, "memsize"); return -1; } /* The check above should ensure this assignment does not overflow. */ memsize = r; } and like this for all Int64 arguments (note we don't need the range check for these): { strtol_error xerr; long long r; xerr = xstrtoll (argv[1], NULL, 0, &r, ""); if (xerr != LONGINT_OK) { fprintf (stderr, _("%s: %s: invalid integer parameter (%s returned %d)\n"), cmd, "size", "xstrtoll", xerr); return -1; } size = r; } Note this also fixes an unrelated bug in guestfish handling of RBufferOut. We were using 'fwrite' without checking the return value, and this could have caused silent failures, eg. in the case where there was not enough disk space to store the resulting file, or even if the program was interrupted (but continued) during the write. Replace this with Gnulib 'full-write', and check the return value and report errors.