You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: access_test.go
    path of file: ./repos/upspin/test
    
    the code of the file until where you have to start completion: // Copyright 2016 The Upspin Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// TODO(adg,r): should test the cases where these ops return NotExist

package test

import (
	"fmt"
	"testing"

	"upspin.io/access"
	"upspin.io/test/testenv"
	"upspin.io/upspin"

	_ "upspin.io/dir/unassigned"
)

func testReadAccess(t *testing.T, r *testenv.Runner) {
	const (
		user              = readerName
		owner             = ownerName
		base              = owner + "/"
		groupDir          = base + "Group"
		publicDir         = base + "public"
		privateDir        = base + "p
    
func testWriteReadAllAccessFile(t *testing.T, r *testenv.Runner) {
	const (
		base             = ownerName + "/readall-access"
		accessFile       = base + "/Access"
		file             = base + "/file"
		subDir           = base + "/dir"
		subDirAccessFile = subDir + "/Access"
		subDirFile       = subDir + "/subfile"
	)

	const (
		readAll          = "read:all\n"
		readAllPlusOwner = "read:all\n*:" + ownerName
	)

	cleanBase := func() {
		r.Delete(accessFile)
		r.Delete(file)
		if r.Failed() {
			t.Fatal(r.Diag())
		}
	}

	cleanSubDir := func() {
		r.Delete(subDirAccessFile)
		r.Delete(subDir)
		if r.Failed() {
			t.Fatal(r.Diag())
		}
	}

	// Always as owner, always use base.
	r.As(ownerName)
	r.MakeDirectory(base)

	// Can create file with read:all if owner is allowed.
	r.Put(accessFile, readAllPlusOwner)
	r.Put(file, "text")
	if r.Failed() {
		t.Fatal(r.Diag())
	}

	// Cannot create file with read:all if owner is not allowed.
	cleanBase()
	r.Put(accessFile, readAll)
	r.Put(file, "text")
	if !r.Failed() {
		t.Fatal("expected permission error writing file with only read:all permission")

	}

	// Cannot add read:all Access if file exists.
	r.Put(file, "text")
	r.Put(accessFile, readAll)
	if !r.Failed() {
		t.Fatal("expected permission error writing read:all with existing files")

	}

	// OK to add read:all in subdirectory if files exist in parent.
	r.Put(accessFile, readAllPlusOwner)
	r.Put(file, "text")
	r.MakeDirectory(subDir)
	r.Put(subDirAccessFile, readAll)
	if r.Failed() {
		t.Fatal(r.Diag())
	}

	// OK to add read:all in subdirectory if controlling Access file is already read:all.
	cleanSubDir()
	cleanBase()
	r.Put(accessFile, readAllPlusOwner)
	r.Put(file, "text")
	r.MakeDirectory(subDir)
	r.Put(subDirFile, "text")
	r.Put(subDirAccessFile, readAll)
	if r.Failed() {
		t.Fatal(r.Diag())
	}
}