~ev/goget-ubuntu-touch/root-size-option

« back to all changes in this revision

Viewing changes to ubuntu-device-flash/snappy_test.go

  • Committer: Snappy Tarmac
  • Author(s): Sergio Schvezov
  • Date: 2015-09-16 11:25:17 UTC
  • mfrom: (212.1.2 goget-ubuntu-touch)
  • Revision ID: snappy_tarmac-20150916112517-7tzw3yidc7e0jtzr
Adding more rules to determine if grub needs to be setup in legacy mode by sergiusens approved by sergiusens,ricmm

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// diskimage - handles ubuntu disk images
 
3
//
 
4
// Copyright (c) 2015 Canonical Ltd.
 
5
//
 
6
// Written by Sergio Schvezov <sergio.schvezov@canonical.com>
 
7
//
 
8
package main
 
9
 
 
10
// This program is free software: you can redistribute it and/or modify it
 
11
// under the terms of the GNU General Public License version 3, as published
 
12
// by the Free Software Foundation.
 
13
//
 
14
// This program is distributed in the hope that it will be useful, but
 
15
// WITHOUT ANY WARRANTY; without even the implied warranties of
 
16
// MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
17
// PURPOSE.  See the GNU General Public License for more details.
 
18
//
 
19
// You should have received a copy of the GNU General Public License along
 
20
// with this program.  If not, see <http://www.gnu.org/licenses/>.
 
21
 
 
22
import (
 
23
        "testing"
 
24
 
 
25
        . "launchpad.net/gocheck"
 
26
)
 
27
 
 
28
// Hook up gocheck into the "go test" runner.
 
29
func Test(t *testing.T) { TestingT(t) }
 
30
 
 
31
type SnappyTestSuite struct{}
 
32
 
 
33
var _ = Suite(&SnappyTestSuite{})
 
34
 
 
35
func (s *SnappyTestSuite) TestLegacy(c *C) {
 
36
        c.Check(isLegacy("rolling", "edge", 1), Equals, false)
 
37
 
 
38
        c.Check(isLegacy("15.04", "edge", 1), Equals, true)
 
39
        c.Check(isLegacy("15.04", "edge", 149), Equals, true)
 
40
        c.Check(isLegacy("15.04", "edge", 150), Equals, false)
 
41
 
 
42
        c.Check(isLegacy("15.04", "alpha", 1), Equals, true)
 
43
        c.Check(isLegacy("15.04", "alpha", 9), Equals, true)
 
44
        c.Check(isLegacy("15.04", "alpha", 10), Equals, false)
 
45
 
 
46
        c.Check(isLegacy("15.04", "stable", 1), Equals, true)
 
47
        c.Check(isLegacy("15.04", "stable", 4), Equals, true)
 
48
        c.Check(isLegacy("15.04", "stable", 5), Equals, false)
 
49
}