-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #898 from restic/prepare-cloud-backends
Prepare more cloud backends, add backend layouts
- Loading branch information
Showing
38 changed files
with
1,782 additions
and
553 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
code { | ||
code, pre { | ||
font-size: 90%; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"restic/options" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
var optionsCmd = &cobra.Command{ | ||
Use: "options", | ||
Short: "print list of extended options", | ||
Long: ` | ||
The "options" command prints a list of extended options. | ||
`, | ||
Hidden: true, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Printf("All Extended Options:\n") | ||
for _, opt := range options.List() { | ||
fmt.Printf(" %-15s %s\n", opt.Namespace+"."+opt.Name, opt.Text) | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
cmdRoot.AddCommand(optionsCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package main | ||
|
||
import ( | ||
"path/filepath" | ||
. "restic/test" | ||
"testing" | ||
) | ||
|
||
func TestRestoreLocalLayout(t *testing.T) { | ||
withTestEnvironment(t, func(env *testEnvironment, gopts GlobalOptions) { | ||
var tests = []struct { | ||
filename string | ||
layout string | ||
}{ | ||
{"repo-layout-cloud.tar.gz", ""}, | ||
{"repo-layout-local.tar.gz", ""}, | ||
{"repo-layout-s3-old.tar.gz", ""}, | ||
{"repo-layout-cloud.tar.gz", "cloud"}, | ||
{"repo-layout-local.tar.gz", "default"}, | ||
{"repo-layout-s3-old.tar.gz", "s3"}, | ||
} | ||
|
||
for _, test := range tests { | ||
datafile := filepath.Join("..", "..", "restic", "backend", "testdata", test.filename) | ||
|
||
SetupTarTestFixture(t, env.base, datafile) | ||
|
||
gopts.extended["local.layout"] = test.layout | ||
|
||
// check the repo | ||
testRunCheck(t, gopts) | ||
|
||
// restore latest snapshot | ||
target := filepath.Join(env.base, "restore") | ||
testRunRestoreLatest(t, gopts, target, nil, "") | ||
|
||
RemoveAll(t, filepath.Join(env.base, "repo")) | ||
RemoveAll(t, target) | ||
} | ||
}) | ||
} |
Oops, something went wrong.