"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
package atexit
import (
"os"
"runtime"
"testing"
"github.com/rclone/rclone/lib/exitcode"
"github.com/stretchr/testify/assert"
)
type fakeSignal struct{}
func (*fakeSignal) String() string {
return "fake"
}
func (*fakeSignal) Signal() {
}
var _ os.Signal = (*fakeSignal)(nil)
func TestExitCode(t *testing.T) {
switch runtime.GOOS {
case "windows", "plan9":
for _, i := range []os.Signal{
os.Interrupt,
os.Kill,
} {
assert.Equal(t, exitCode(i), exitcode.UncategorizedError)
}
default:
// SIGINT (2) and SIGKILL (9) are portable numbers specified by POSIX.
assert.Equal(t, exitCode(os.Interrupt), 128+2)
assert.Equal(t, exitCode(os.Kill), 128+9)
}
// Never a real signal
assert.Equal(t, exitCode(&fakeSignal{}), exitcode.UncategorizedError)
}