Index: postinstall_runner_action_unittest.cc |
diff --git a/postinstall_runner_action_unittest.cc b/postinstall_runner_action_unittest.cc |
index 7f4e65c16e33e60e7d310548d29afa61a137830a..cb6ec0dbef1e2f7db1a4bcbfcd777325869b47b7 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" |
@@ -91,13 +95,18 @@ void PostinstallRunnerActionTest::DoTest(bool do_losetup, bool do_err_script) { |
"count=1")); |
// format it as ext3 |
petkov
2011/02/01 01:14:45
update comment
|
- ASSERT_EQ(0, system("mkfs.ext3 -F image.dat")); |
+ 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"; |
} |