...

Source file src/github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/fuse/fuse_linux_test.go

Documentation: github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/fuse

     1  // Copyright 2021 Google LLC
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  //go:build linux
    16  // +build linux
    17  
    18  package fuse_test
    19  
    20  import (
    21  	"os"
    22  	"testing"
    23  
    24  	"github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/fuse"
    25  )
    26  
    27  func TestFUSESupport(t *testing.T) {
    28  	if testing.Short() {
    29  		t.Skip("skipping fuse tests in short mode.")
    30  	}
    31  
    32  	removePath := func() func() {
    33  		original := os.Getenv("PATH")
    34  		os.Unsetenv("PATH")
    35  		return func() { os.Setenv("PATH", original) }
    36  	}
    37  	if !fuse.Supported() {
    38  		t.Fatal("expected FUSE to be supported")
    39  	}
    40  	cleanup := removePath()
    41  	defer cleanup()
    42  
    43  	if !fuse.Supported() {
    44  		t.Fatal("expected FUSE to be supported")
    45  	}
    46  
    47  }
    48  

View as plain text