...

Source file src/github.com/containerd/continuity/fs/dtype_test.go

Documentation: github.com/containerd/continuity/fs

     1  /*
     2     Copyright The containerd Authors.
     3  
     4     Licensed under the Apache License, Version 2.0 (the "License");
     5     you may not use this file except in compliance with the License.
     6     You may obtain a copy of the License at
     7  
     8         http://www.apache.org/licenses/LICENSE-2.0
     9  
    10     Unless required by applicable law or agreed to in writing, software
    11     distributed under the License is distributed on an "AS IS" BASIS,
    12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13     See the License for the specific language governing permissions and
    14     limitations under the License.
    15  */
    16  
    17  package fs
    18  
    19  import (
    20  	"testing"
    21  
    22  	"github.com/containerd/continuity/testutil"
    23  )
    24  
    25  func TestRequiresRootNOP(t *testing.T) {
    26  	// This is a dummy test case that exist to call
    27  	// testutil.RequiresRoot() on non-linux platforms.  This is
    28  	// needed because the Makfile root-coverage tests target
    29  	// determines which packages contain root test by grepping for
    30  	// testutil.RequiresRoot.  Within the fs package, the only test
    31  	// that references this symbol is in dtype_linux_test.go, but
    32  	// that file is only built on linux.  Since the Makefile is not
    33  	// go build tag aware it sees this file and then tries to run
    34  	// the following command on all platforms: "go test ...
    35  	// github.com/containerd/continuity/fs -test.root".  On
    36  	// non-linux platforms this fails because there are no tests in
    37  	// the "fs" package that reference testutil.RequiresRoot.  To
    38  	// fix this problem we'll add a reference to this symbol below.
    39  
    40  	testutil.RequiresRoot(t)
    41  }
    42  

View as plain text