• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/python2
2#
3# Copyright (c) 2010 The Chromium Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7import logging, os
8
9from autotest_lib.client.bin import test, utils
10from autotest_lib.client.common_lib import error
11
12
13class platform_Nvram(test.test):
14    """
15    Test /dev/nvram
16    """
17    version = 1
18
19    def run_once(self):
20        nvram_path = '/dev/nvram'
21        if not os.path.exists(nvram_path):
22            raise error.TestFail('%s does not exist.' % nvram_path)
23        if not open(nvram_path, 'rb').read(1):
24            raise error.TestFail('cannot read from %s.' % nvram_path)
25