filestorageSuite.TestRelativePath fails because s390x host /tmp is different

Bug #1568179 reported by Curtis Hovey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Reed O'Brien

Bug Description

As seen at
    http://reports.vapour.ws/releases/issue/56d9a7bb749a564f7d1d88f3

filestorageSuite.TestRelativePath fails because s390x host /tmp is different. The s390x host that runs this machine uses /home/tmp because that is the bug disk.

filestorage_test.go:243:
    c.Assert(url, gc.Equals, utils.MakeFileURL(dir)+"/a")
... obtained string = "file:///home/tmp/check-5577006791947779410/9/a"
... expected string = "file:///tmp/check-5577006791947779410/9/a"

Changed in juju-core:
milestone: 2.0-beta4 → 2.0.0
Ian Booth (wallyworld)
Changed in juju-core:
assignee: nobody → Reed O'Brien (reedobrien)
Revision history for this message
Reed O'Brien (reedobrien) wrote :

IIUC s390x doesn't really have a proper disk. So we have one mounted for CI purposes at `/home` and we have a tempdir there -- `/home/tmp`. To make things work we currently have a symlink from `/tmp` => `/home/tmp`.

So `TMPDIR` = `/home` in the environment but is actually `/home/tmp`.

The test does the following:

Create some subdirectories

 dir := c.MkDir() // => /tmp/gocheck-00000/
 err := os.MkdirAll(filepath.Join(dir, "a", "b", "c"), os.ModePerm)
 ...

We then move into the sub-directory

 err = os.Chdir(filepath.Join(dir, "a", "b", "c"))
 ...

The following reader will use filepath.Abs to get the path

 reader, err := filestorage.NewFileStorageReader("../..")

And returns the absolute path in the call to URL.

 url, err := reader.URL("") // => file://home/tmp/gocheck-0000/a

Now url does not equal a file url made from dir:

 c.Assert(url, gc.Equals, utils.MakeFileURL(dir)+"/a") // => FAIL

I think this will fix itself if we set the TMPDIR variable to /home/tmp in CI test runs on s390x -- or wherever we symlink /tmp to.

Revision history for this message
Reed O'Brien (reedobrien) wrote :

Seem correct to you sinzui?

Changed in juju-core:
status: Triaged → In Progress
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0.0 → 2.0-beta8
status: Fix Committed → Fix Released
affects: juju-core → juju
Changed in juju:
milestone: 2.0-beta8 → none
milestone: none → 2.0-beta8
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.