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

Side by Side Diff: src/platform/update_engine/integration_unittest.cc

Issue 467051: AU: Use Omaha ID rather than MAC address in delta updater (Closed)
Patch Set: fixes for review Created 11 years 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
OLDNEW
1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2009 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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 #include <glib.h> 7 #include <glib.h>
8 #include <pthread.h> 8 #include <pthread.h>
9 #include <gtest/gtest.h> 9 #include <gtest/gtest.h>
10 #include "update_engine/download_action.h" 10 #include "update_engine/download_action.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 BondActions(&update_check_action, &response_handler_action); 126 BondActions(&update_check_action, &response_handler_action);
127 BondActions(&response_handler_action, &download_action); 127 BondActions(&response_handler_action, &download_action);
128 BondActions(&download_action, &install_action); 128 BondActions(&download_action, &install_action);
129 BondActions(&install_action, &postinstall_runner_action); 129 BondActions(&install_action, &postinstall_runner_action);
130 BondActions(&postinstall_runner_action, &set_bootable_flag_action); 130 BondActions(&postinstall_runner_action, &set_bootable_flag_action);
131 131
132 // Set up filesystem to trick some of the actions 132 // Set up filesystem to trick some of the actions
133 ASSERT_EQ(0, System(string("rm -rf ") + kTestDir)); 133 ASSERT_EQ(0, System(string("rm -rf ") + kTestDir));
134 ASSERT_EQ(0, system("rm -f /tmp/update_engine_test_postinst_out.txt")); 134 ASSERT_EQ(0, system("rm -f /tmp/update_engine_test_postinst_out.txt"));
135 ASSERT_EQ(0, System(string("mkdir -p ") + kTestDir + "/etc")); 135 ASSERT_EQ(0, System(string("mkdir -p ") + kTestDir + "/etc"));
136 ASSERT_EQ(0, system((string("mkdir -p ") + kTestDir +
137 utils::kStatefulPartition +
138 "/etc").c_str()));
136 ASSERT_TRUE(WriteFileString(string(kTestDir) + "/etc/lsb-release", 139 ASSERT_TRUE(WriteFileString(string(kTestDir) + "/etc/lsb-release",
137 "GOOGLE_RELEASE=0.2.0.0\n" 140 "GOOGLE_RELEASE=0.2.0.0\n"
138 "GOOGLE_TRACK=unittest-track")); 141 "GOOGLE_TRACK=unittest-track"));
139 ASSERT_EQ(0, System(string("touch ") + kTestDir + "/dev1")); 142 ASSERT_EQ(0, System(string("touch ") + kTestDir + "/dev1"));
140 ASSERT_EQ(0, System(string("touch ") + kTestDir + "/dev2")); 143 ASSERT_EQ(0, System(string("touch ") + kTestDir + "/dev2"));
141 ASSERT_TRUE(WriteFileVector(string(kTestDir) + "/dev", GenerateSampleMbr())); 144 ASSERT_TRUE(WriteFileVector(string(kTestDir) + "/dev", GenerateSampleMbr()));
142 145
143 request_prep_action.set_root(kTestDir); 146 request_prep_action.set_root(kTestDir);
144 response_handler_action.set_boot_device(string(kTestDir) + "/dev1"); 147 response_handler_action.set_boot_device(string(kTestDir) + "/dev1");
145 148
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 "/tmp/update_engine_test_postinst_out.txt", 183 "/tmp/update_engine_test_postinst_out.txt",
181 &file_data)); 184 &file_data));
182 EXPECT_EQ("POSTINST_DONE\n", file_data); 185 EXPECT_EQ("POSTINST_DONE\n", file_data);
183 186
184 // cleanup 187 // cleanup
185 ASSERT_EQ(0, System(string("rm -rf ") + kTestDir)); 188 ASSERT_EQ(0, System(string("rm -rf ") + kTestDir));
186 ASSERT_EQ(0, system("rm -f /tmp/update_engine_test_postinst_out.txt")); 189 ASSERT_EQ(0, system("rm -f /tmp/update_engine_test_postinst_out.txt"));
187 } 190 }
188 191
189 } // namespace chromeos_update_engine 192 } // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « src/platform/update_engine/install_action_unittest.cc ('k') | src/platform/update_engine/omaha_request_prep_action.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698