From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Xu Subject: Re: [Qemu-devel] [kvm-unit-tests PATCH v6 2/3] run_tests: put logs into per-test file Date: Thu, 12 Jan 2017 18:35:57 +0800 Message-ID: <20170112103557.GP4450@pxdev.xzpeter.org> References: <1484192182-13760-1-git-send-email-peterx@redhat.com> <1484192182-13760-3-git-send-email-peterx@redhat.com> <20170112100405.tyroqjvxpxdxocuc@hawk.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= To: Andrew Jones Return-path: Received: from mx1.redhat.com ([209.132.183.28]:46836 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751968AbdALKhH (ORCPT ); Thu, 12 Jan 2017 05:37:07 -0500 Content-Disposition: inline In-Reply-To: <20170112100405.tyroqjvxpxdxocuc@hawk.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Jan 12, 2017 at 11:04:05AM +0100, Andrew Jones wrote: [...] > > config=$TEST_DIR/unittests.cfg > > -rm -f test.log > > -printf "BUILD_HEAD=$(cat build-head)\n\n" > test.log > > + > > +rm -rf $unittest_log_dir.old > > +[ -d $unittest_log_dir ] && mv $unittest_log_dir $unittest_log_dir.old > > +mkdir $unittest_log_dir || exit 2 > > + > > +echo "BUILD_HEAD=$(cat build-head)" > $unittest_log_dir/SUMMARY > > + > > nit: to be 100% correct all the references to the log dir should have > "'s around them in order to handle spaces, or other shell ambiguous > characters, in the name. For example, mkdir $log_dir, where $log_dir > is "my tests" would create two directories, "my" and "tests" without > the quotes. Anyway, I'm not too worried about someone choosing a > weird log dir name, nor even changing it from the default. > > Isn't bash fun :-) It is, as long as it won't break my system... (Once I accidentally did a "rm -rf /lib" in Bash when I was still using FreeBSD... Bash became less funny since then ;-). I'll add them if I'm going to have another spin. [...] > Reviewed-by: Andrew Jones Thanks for reviewing! -- peterx