Mailinglist Archive: yast-commit (819 mails)

< Previous Next >
[yast-commit] r55088 - in /trunk/installation: package/yast2-installation.changes src/include/scr_switch_debugger.ycp src/inst_finish/switch_scr_finish.ycp
  • From: locilka@xxxxxxxxxxxxxxxx
  • Date: Tue, 27 Jan 2009 16:17:17 -0000
  • Message-id: <E1LRqcn-0002xq-SF@xxxxxxxxxxxxxxxx>
Author: locilka
Date: Tue Jan 27 17:17:17 2009
New Revision: 55088

URL: http://svn.opensuse.org/viewcvs/yast?rev=55088&view=rev
Log:
- Added test for checking free space when SCR switch fails
(bnc #460477).


Modified:
trunk/installation/package/yast2-installation.changes
trunk/installation/src/include/scr_switch_debugger.ycp
trunk/installation/src/inst_finish/switch_scr_finish.ycp

Modified: trunk/installation/package/yast2-installation.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/installation/package/yast2-installation.changes?rev=55088&r1=55087&r2=55088&view=diff
==============================================================================
--- trunk/installation/package/yast2-installation.changes (original)
+++ trunk/installation/package/yast2-installation.changes Tue Jan 27 17:17:17
2009
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue Jan 27 17:13:57 CET 2009 - locilka@xxxxxxx
+
+- Added test for checking free space when SCR switch fails
+ (bnc #460477).
+
+-------------------------------------------------------------------
Mon Jan 26 13:58:00 CET 2009 - locilka@xxxxxxx

- Disabling [Back] buttons in the very first interactive dialogs

Modified: trunk/installation/src/include/scr_switch_debugger.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/installation/src/include/scr_switch_debugger.ycp?rev=55088&r1=55087&r2=55088&view=diff
==============================================================================
--- trunk/installation/src/include/scr_switch_debugger.ycp (original)
+++ trunk/installation/src/include/scr_switch_debugger.ycp Tue Jan 27 17:17:17
2009
@@ -28,6 +28,7 @@
import "Icon";
import "Installation";
import "HTML";
+ import "String";

// test result (Checking for xyz... Passed)
string result_ok = _("Passed");
@@ -279,6 +280,66 @@
return test_result;
}

+ boolean RunSCRSwitchTest_FreeSpace () {
+ ReportProgress (_("Checking free space"));
+
+ // Local command
+ map parts_cmd = (map) WFM::Execute (.local.bash_output,
+ "mount " +
+ "| grep -v '^\\(/proc\\) on' " +
+ "| sed 's/\\/.* on \\(.*\\) type .*/\\1/'"
+ );
+
+ map <string, integer> partitions = $[];
+
+ if (parts_cmd["exit"]:-1 != 0) {
+ y2error ("Cannot find out current partitions");
+ // even if it is an error, we should check more
+ return true;
+ } else {
+ // Spash at the end or not
+ string inst_dir = Installation::destdir + (regexpmatch
(Installation::destdir, "/$") ? "" : "/");
+ integer inst_dir_length = size (inst_dir);
+ y2milestone ("InstDir: '%1'", inst_dir);
+
+ foreach (string one_partition, splitstring (parts_cmd["stdout"]:"",
"\n"), {
+ // begin of the one_partition matches the inst_dir
+ if (substring (one_partition, 0, inst_dir_length) == inst_dir) {
+ // chrooted to the Installation::destdir
+ partitions[substring (one_partition, inst_dir_length - 1)] =
+ (integer) SCR::Read (.system.freespace, one_partition);
+ }
+ });
+ }
+
+ y2milestone ("Partitions: %1", partitions);
+
+ boolean test_result = true;
+
+ foreach (string partition, integer free_space, partitions, {
+ boolean this_test = true;
+
+ if (free_space <= 0) {
+ test_result = false;
+ this_test = false;
+ }
+
+ ReportTest (
+ sformat (
+ // test result, %1 is replaced with the directory, e.g.,
/var
+ // %2 is replaced with the free space in that partition,
e.g., 2.8 GB
+ _("Checking for free space in the %1 directory: %2"),
+ partition,
+ // linked to the text above (sometimes replaces the '%2')
+ (free_space < 0 ? _("Unable to find
out"):String::FormatSize (free_space)),
+ ),
+ this_test
+ );
+ });
+
+ return test_result;
+ }
+
// tries to get all installed packages from new SCR
boolean RunSCRSwitchTest_DoRPMCheck () {
map <string, any> test = (map <string, any>) SCR::Execute
(.target.bash_output,
@@ -505,6 +566,7 @@
if (! RunSCRSwitchTest_BinaryExists()) return false;
if (! RunSCRSwitchTest_DoChroot()) return false;
if (! RunSCRSwitchTest_Y2BASE()) return false;
+ if (! RunSCRSwitchTest_FreeSpace()) return false;
if (! RunSCRSwitchTest_DoRPMCheck()) return false;

// checking all mandatory packages

Modified: trunk/installation/src/inst_finish/switch_scr_finish.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/installation/src/inst_finish/switch_scr_finish.ycp?rev=55088&r1=55087&r2=55088&view=diff
==============================================================================
--- trunk/installation/src/inst_finish/switch_scr_finish.ycp (original)
+++ trunk/installation/src/inst_finish/switch_scr_finish.ycp Tue Jan 27
17:17:17 2009
@@ -72,6 +72,16 @@
return true;
}

+void CheckFreeSpaceNow () {
+ map ret_exec = (map) SCR::Execute (.target.bash_output, "/bin/df -h");
+
+ if (ret_exec["exit"]:-1 != 0) {
+ y2error ("Cannot find out free space: %1", ret_exec);
+ } else {
+ y2milestone ("Free space: \n%1", mergestring (splitstring
(ret_exec["stdout"]:"", "\\n"), "\n"));
+ }
+}
+
boolean TestTheNewSCRHandler () {
integer SCR_PID = FindSCRPID();

@@ -81,6 +91,9 @@

if (SCR_PID > 0) SwitchY2Debug (SCR_PID);

+ // BNC #460477
+ CheckFreeSpaceNow();
+
return ret;
}


--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages