Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(655)

Unified Diff: postinstall_runner_action_unittest.cc

Issue 6347053: Try to mount new filesystem w/ ext2 first, then ext3. (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: fix comment for review Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « postinstall_runner_action.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: postinstall_runner_action_unittest.cc
diff --git a/postinstall_runner_action_unittest.cc b/postinstall_runner_action_unittest.cc
index 7f4e65c16e33e60e7d310548d29afa61a137830a..baf03b656f0fcb727f6302e308570c21cf3fa349 100644
--- a/postinstall_runner_action_unittest.cc
+++ b/postinstall_runner_action_unittest.cc
@@ -5,9 +5,13 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
+
#include <string>
#include <vector>
+
+#include <base/string_util.h>
#include <gtest/gtest.h>
+
#include "update_engine/postinstall_runner_action.h"
#include "update_engine/test_utils.h"
#include "update_engine/utils.h"
@@ -90,14 +94,19 @@ void PostinstallRunnerActionTest::DoTest(bool do_losetup, bool do_err_script) {
ASSERT_EQ(0, system("dd if=/dev/zero of=image.dat seek=10485759 bs=1 "
"count=1"));
- // format it as ext3
- ASSERT_EQ(0, system("mkfs.ext3 -F image.dat"));
+ // format it as ext2
+ ASSERT_EQ(0, system("mkfs.ext2 -F image.dat"));
// mount it
ASSERT_EQ(0, System(string("mount -o loop image.dat ") + mountpoint));
// put a postinst script in
- string script = string("#!/bin/bash\ntouch ") + cwd + "/postinst_called\n";
+ string script = StringPrintf("#!/bin/bash\n"
+ "mount | grep au_postint_mount | grep ext2\n"
+ "if [ $? -eq 0 ]; then\n"
+ " touch %s/postinst_called\n"
+ "fi\n",
+ cwd.c_str());
if (do_err_script) {
script = "#!/bin/bash\nexit 1";
}
« no previous file with comments | « postinstall_runner_action.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698