github.com/wallyworld/juju@v0.0.0-20161013125918-6cf1bc9d917a/worker/uniter/runner/jujuc/storage_test.go (about)

     1  // Copyright 2015 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package jujuc_test
     5  
     6  import (
     7  	gc "gopkg.in/check.v1"
     8  
     9  	jujuctesting "github.com/juju/juju/worker/uniter/runner/jujuc/testing"
    10  )
    11  
    12  var (
    13  	storageAttributes = map[string]interface{}{
    14  		"location": "/dev/sda",
    15  		"kind":     "block",
    16  	}
    17  
    18  	storageName = "data/0"
    19  )
    20  
    21  type storageSuite struct {
    22  	ContextSuite
    23  
    24  	storageName string
    25  	location    string
    26  }
    27  
    28  func (s *storageSuite) SetUpTest(c *gc.C) {
    29  	s.ContextSuite.SetUpTest(c)
    30  
    31  	s.storageName = "data/0"
    32  	s.location = "/dev/sda"
    33  }
    34  
    35  func (s *storageSuite) newHookContext() (*jujuctesting.Context, *jujuctesting.ContextInfo) {
    36  	hctx, info := s.NewHookContext()
    37  	info.SetBlockStorage(s.storageName, s.location, s.Stub)
    38  	info.SetStorageTag(s.storageName)
    39  	return hctx, info
    40  }