~paulgear/charms/trusty/quassel-core/trunk

« back to all changes in this revision

Viewing changes to tests/50-basic-deploy

  • Committer: Paul Gear
  • Date: 2015-04-20 02:19:55 UTC
  • Revision ID: paul.gear@canonical.com-20150420021955-v0wscdvctwqomxw2
Fix amulet tests

- Correctly reference class variables from instance methods
- Update command for running quasselcore and check results correctly

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 
42
42
    def check_file_content(self, name, find):
43
43
        """Check that the named file exists and contains the find text."""
44
 
        stat = self.u.file(name)
 
44
        stat = TestDeployment.u.file(name)
45
45
        if stat is None:
46
46
            amulet.raise_status(amulet.FAIL,
47
47
                    msg="Could not retrieve status of " + name)
48
 
        content = self.u.file_contents(name)
 
48
        content = TestDeployment.u.file_contents(name)
49
49
        if not content.find(find):
50
50
            amulet.raise_status(amulet.FAIL,
51
51
                    msg=name + " does not contain the required text (" + find + ")")
71
71
                name)
72
72
 
73
73
    def test_running_quassel(self):
74
 
        output = self.u.run('ps aux|grep "[q]uasselcore"')
75
 
        if not output.find("quasselcore"):
 
74
        (output, exit) = TestDeployment.u.run('ps aux|grep -q "[q]uasselcore"')
 
75
        if exit != 0 or not output.find("quasselcore"):
76
76
            amulet.raise_status(amulet.FAIL, msg="quasselcore did not start correctly")
77
77
 
78
78