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

Side by Side Diff: postinstall_runner_action_unittest.cc

Issue 4679003: AU: Remove obsolete postinst --postcommit call. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
Patch Set: fix copyrights Created 10 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « postinstall_runner_action.cc ('k') | update_attempter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <sys/stat.h> 5 #include <sys/stat.h>
6 #include <sys/types.h> 6 #include <sys/types.h>
7 #include <unistd.h> 7 #include <unistd.h>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 #include <gtest/gtest.h> 10 #include <gtest/gtest.h>
11 #include "update_engine/postinstall_runner_action.h" 11 #include "update_engine/postinstall_runner_action.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 dev[strlen(dev) - 1] = '\0'; 109 dev[strlen(dev) - 1] = '\0';
110 110
111 if (do_losetup) 111 if (do_losetup)
112 ASSERT_EQ(0, System(string("losetup ") + dev + " " + cwd + "/image.dat")); 112 ASSERT_EQ(0, System(string("losetup ") + dev + " " + cwd + "/image.dat"));
113 113
114 ActionProcessor processor; 114 ActionProcessor processor;
115 ObjectFeederAction<InstallPlan> feeder_action; 115 ObjectFeederAction<InstallPlan> feeder_action;
116 InstallPlan install_plan; 116 InstallPlan install_plan;
117 install_plan.install_path = dev; 117 install_plan.install_path = dev;
118 feeder_action.set_obj(install_plan); 118 feeder_action.set_obj(install_plan);
119 PostinstallRunnerAction runner_action(true); 119 PostinstallRunnerAction runner_action;
120 BondActions(&feeder_action, &runner_action); 120 BondActions(&feeder_action, &runner_action);
121 ObjectCollectorAction<InstallPlan> collector_action; 121 ObjectCollectorAction<InstallPlan> collector_action;
122 BondActions(&runner_action, &collector_action); 122 BondActions(&runner_action, &collector_action);
123 PostinstActionProcessorDelegate delegate; 123 PostinstActionProcessorDelegate delegate;
124 processor.EnqueueAction(&feeder_action); 124 processor.EnqueueAction(&feeder_action);
125 processor.EnqueueAction(&runner_action); 125 processor.EnqueueAction(&runner_action);
126 processor.EnqueueAction(&collector_action); 126 processor.EnqueueAction(&collector_action);
127 processor.set_delegate(&delegate); 127 processor.set_delegate(&delegate);
128 processor.StartProcessing(); 128 processor.StartProcessing();
129 ASSERT_FALSE(processor.IsRunning()) 129 ASSERT_FALSE(processor.IsRunning())
(...skipping 16 matching lines...) Expand all
146 146
147 if (do_losetup) 147 if (do_losetup)
148 ASSERT_EQ(0, System(string("losetup -d ") + dev)); 148 ASSERT_EQ(0, System(string("losetup -d ") + dev));
149 ASSERT_EQ(0, System(string("rm -f ") + cwd + "/postinst_called")); 149 ASSERT_EQ(0, System(string("rm -f ") + cwd + "/postinst_called"));
150 ASSERT_EQ(0, System(string("rm -f ") + cwd + "/image.dat")); 150 ASSERT_EQ(0, System(string("rm -f ") + cwd + "/image.dat"));
151 } 151 }
152 152
153 // Death tests don't seem to be working on Hardy 153 // Death tests don't seem to be working on Hardy
154 TEST_F(PostinstallRunnerActionTest, DISABLED_RunAsRootDeathTest) { 154 TEST_F(PostinstallRunnerActionTest, DISABLED_RunAsRootDeathTest) {
155 ASSERT_EQ(0, getuid()); 155 ASSERT_EQ(0, getuid());
156 PostinstallRunnerAction runner_action(true); 156 PostinstallRunnerAction runner_action;
157 ASSERT_DEATH({ runner_action.TerminateProcessing(); }, 157 ASSERT_DEATH({ runner_action.TerminateProcessing(); },
158 "postinstall_runner_action.h:.*] Check failed"); 158 "postinstall_runner_action.h:.*] Check failed");
159 } 159 }
160 160
161 } // namespace chromeos_update_engine 161 } // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « postinstall_runner_action.cc ('k') | update_attempter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698