コード例 #1
0
func getCurrentBootDir(c *check.C) string {
	system, err := partition.BootSystem()
	c.Assert(err, check.IsNil, check.Commentf("Error getting the boot system: %s", err))
	bootDir := partition.BootDir(system)
	current, err := partition.CurrentPartition()
	c.Assert(err, check.IsNil, check.Commentf("Error getting the current partition: %s", err))
	return path.Join(bootDir, current)
}
コード例 #2
0
func (zeroSizeInitrd) unset(c *check.C) {
	boot, err := partition.BootSystem()
	c.Assert(err, check.IsNil, check.Commentf("Error getting the boot system: %s", err))
	dir := partition.BootDir(boot)

	bootFileNamePattern := newKernelFilenamePattern(c, boot, false)
	commonUnset(c, dir, bootFileNamePattern, initrdFilename)
}
コード例 #3
0
ファイル: update_test.go プロジェクト: pombredanne/snappy-1
func (s *updateSuite) assertBootDirContents(c *check.C) {
	system, err := partition.BootSystem()
	c.Assert(err, check.IsNil, check.Commentf("Error getting the boot system: %s", err))
	current, err := partition.CurrentPartition()
	c.Assert(err, check.IsNil, check.Commentf("Error getting the current partition: %s", err))
	files, err := ioutil.ReadDir(
		path.Join(partition.BootDir(system), partition.OtherPartition(current)))
	c.Assert(err, check.IsNil, check.Commentf("Error reading the other partition boot dir: %s", err))

	expectedFileNames := []string{"hardware.yaml", "initrd.img", "vmlinuz"}
	if system == "uboot" {
		expectedFileNames = append([]string{"dtbs"}, expectedFileNames...)
	}

	fileNames := []string{}
	for _, f := range files {
		fileNames = append(fileNames, f.Name())
	}
	c.Assert(fileNames, check.DeepEquals, expectedFileNames,
		check.Commentf("Wrong files in the other partition boot dir"))
}