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

Issue 5022001: AU: Allow override of "appid" through the lsb-release file. (Closed)

Created:
10 years, 1 month ago by petkov
Modified:
9 years, 7 months ago
Reviewers:
adlr
CC:
chromium-os-reviews_chromium.org, petkov, adlr
Visibility:
Public.

Description

AU: Allow override of "appid" through the lsb-release file. This will allow us to split Omaha configurations into OEM-specific files. BUG=6145 TEST=unit tests, tested on device Change-Id: I1f9b44d2a984988723ec81bf77594161c35460a2 Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=d315dc7

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -1 line) Patch
M omaha_request_params.cc View 1 chunk +3 lines, -1 line 0 comments Download
M omaha_request_params_unittest.cc View 1 chunk +23 lines, -0 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
petkov
10 years, 1 month ago (2010-11-15 17:36:04 UTC) #1
adlr
10 years, 1 month ago (2010-11-15 17:50:02 UTC) #2
LGTM. thanks!

On Mon, Nov 15, 2010 at 9:36 AM, <petkov@chromium.org> wrote:

> Reviewers: adlr,
>
> Description:
> AU: Allow override of "appid" through the lsb-release file.
>
> This will allow us to split Omaha configurations into OEM-specific files.
>
> BUG=6145
> TEST=unit tests, tested on device
>
> Change-Id: I1f9b44d2a984988723ec81bf77594161c35460a2
>
> Please review this at http://codereview.chromium.org/5022001/
>
> SVN Base: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
>
> Affected files:
>  M omaha_request_params.cc
>  M omaha_request_params_unittest.cc
>
>
> Index: omaha_request_params.cc
> diff --git a/omaha_request_params.cc b/omaha_request_params.cc
> index
>
19bcc6a66ea057ecef5705e57bfa2c530e6f8f14..6884c839a478265c4ab3072cb1fe6ef77cfa28ff
> 100644
> --- a/omaha_request_params.cc
> +++ b/omaha_request_params.cc
> @@ -47,7 +47,9 @@ bool OmahaRequestDeviceParams::Init(const std::string&
> in_app_version,
>       GetLsbValue("CHROMEOS_RELEASE_VERSION", "", NULL) : in_app_version;
>   os_sp = app_version + "_" + GetMachineType();
>   os_board = GetLsbValue("CHROMEOS_RELEASE_BOARD", "", NULL);
> -  app_id = OmahaRequestParams::kAppId;
> +  app_id = GetLsbValue("CHROMEOS_RELEASE_APPID",
> +                       OmahaRequestParams::kAppId,
> +                       NULL);
>   app_lang = "en-US";
>   app_track = GetLsbValue(
>       kUpdateTrackKey,
> Index: omaha_request_params_unittest.cc
> diff --git a/omaha_request_params_unittest.cc
> b/omaha_request_params_unittest.cc
> index
>
65d86cbc3de87f940cd92c111ba76556ff95a29b..77d01d2ce7435f8325b5278aaf09430e45dce748
> 100644
> --- a/omaha_request_params_unittest.cc
> +++ b/omaha_request_params_unittest.cc
> @@ -96,6 +96,29 @@ TEST_F(OmahaRequestDeviceParamsTest, SimpleTest) {
>   EXPECT_EQ("http://www.google.com", out.update_url);
>  }
>
> +TEST_F(OmahaRequestDeviceParamsTest, AppIDTest) {
> +  ASSERT_TRUE(WriteFileString(
> +      kTestDir + "/etc/lsb-release",
> +      "CHROMEOS_RELEASE_BOARD=arm-generic\n"
> +      "CHROMEOS_RELEASE_FOO=bar\n"
> +      "CHROMEOS_RELEASE_VERSION=0.2.2.3\n"
> +      "CHROMEOS_RELEASE_TRACK=footrack\n"
> +      "CHROMEOS_RELEASE_APPID={58c35cef-9d30-476e-9098-ce20377d535d}\n"
> +      "CHROMEOS_AUSERVER=http://www.google.com"));
> +  OmahaRequestParams out;
> +  EXPECT_TRUE(DoTest(&out, "", ""));
> +  EXPECT_EQ("Chrome OS", out.os_platform);
> +  EXPECT_EQ(string("0.2.2.3_") + GetMachineType(), out.os_sp);
> +  EXPECT_EQ("arm-generic", out.os_board);
> +  EXPECT_EQ("{58c35cef-9d30-476e-9098-ce20377d535d}", out.app_id);
> +  EXPECT_EQ("0.2.2.3", out.app_version);
> +  EXPECT_EQ("en-US", out.app_lang);
> +  EXPECT_EQ("", out.hardware_class);
> +  EXPECT_TRUE(out.delta_okay);
> +  EXPECT_EQ("footrack", out.app_track);
> +  EXPECT_EQ("http://www.google.com", out.update_url);
> +}
> +
>  TEST_F(OmahaRequestDeviceParamsTest, MissingTrackTest) {
>   ASSERT_TRUE(WriteFileString(
>       kTestDir + "/etc/lsb-release",
>
>
>

Powered by Google App Engine
This is Rietveld 408576698