File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 - run : hack/e2e/setup-plural.sh
2626 env :
2727 CLI_E2E_CONF : ${{ secrets.CLI_E2E_CONF }}
28+ CLI_E2E_IDENTITY_FILE : ${{ secrets.CLI_E2E_IDENTITY_FILE }}
29+ CLI_E2E_KEY_FILE : ${{ secrets.CLI_E2E_KEY_FILE }}
2830 CLI_E2E_PUBLIC_KEY : ${{ secrets.CLI_E2E_PUBLIC_KEY }}
2931 CLI_E2E_PRIVATE_KEY : ${{ secrets.CLI_E2E_PRIVATE_KEY }}
32+ CLI_E2E_SHARING_PRIVATE_KEY : ${{ secrets.CLI_E2E_SHARING_PRIVATE_KEY }}
33+ CLI_E2E_SHARING_PUBLIC_KEY : ${{ secrets.CLI_E2E_SHARING_PUBLIC_KEY }}
3034 - run : go test -v -race ./pkg/test/e2e/... -tags="e2e"
3135 - run : |
3236 cd $HOME/test
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ source hack/lib.sh
99
1010PLURALHOME=" $HOME " /.plural
1111TESTDIR=" $HOME " /test
12+ SHAREDIR=" $HOME " /share
1213
1314mkdir -p " $PLURALHOME "
1415mkdir -p " $HOME " /.ssh
@@ -18,19 +19,41 @@ cat << EOF > "$PLURALHOME"/config.yml
1819$CLI_E2E_CONF
1920EOF
2021
22+ echodate " Creating identity ..."
23+ cat << EOF > "$PLURALHOME "/identity
24+ $CLI_E2E_IDENTITY_FILE
25+ EOF
26+
27+ echodate " Creating key ..."
28+ cat << EOF > "$PLURALHOME "/key
29+ $CLI_E2E_KEY_FILE
30+ EOF
31+
2132echodate " Creating private ssh key ..."
2233cat << EOF > "$HOME "/.ssh/id_rsa
2334$CLI_E2E_PRIVATE_KEY
2435EOF
2536
37+ echodate " Creating private sharing ssh key ..."
38+ cat << EOF > "$HOME "/.ssh/id_sharing
39+ $CLI_E2E_SHARING_PRIVATE_KEY
40+ EOF
41+
2642echodate " Creating public ssh key ..."
2743cat << EOF > "$HOME "/.ssh/id_rsa.pub
2844$CLI_E2E_PUBLIC_KEY
2945EOF
3046
47+ echodate " Creating public sharing ssh key ..."
48+ cat << EOF > "$HOME "/.ssh/id_sharing.pub
49+ $CLI_E2E_SHARING_PUBLIC_KEY
50+ EOF
51+
3152chmod 600 ~ /.ssh/id_rsa
53+ chmod 600 ~ /.ssh/id_sharing
3254
3355git -c core.sshCommand=" ssh -i ~/.ssh/id_rsa" clone git@github.com:pluralsh/cli-e2e-tests.git " $TESTDIR "
56+ git -c core.sshCommand=" ssh -i ~/.ssh/id_sharing" clone git@github.com:pluralsh/e2e-sharing.git " $SHAREDIR "
3457git config --global user.email cli-e2e@pluraldev.sh
3558git config --global user.name cli-e2e
3659
Original file line number Diff line number Diff line change @@ -37,3 +37,20 @@ func TestKeyValidation(t *testing.T) {
3737 assert .Error (t , err , "expected: 'the key fingerprint doesn't match' error" )
3838 fmt .Println (string (cmdOutput ))
3939}
40+
41+ func TestRepoSharing (t * testing.T ) {
42+ homeDir , err := os .UserHomeDir ()
43+ assert .NoError (t , err )
44+ testDir := path .Join (homeDir , "share" )
45+ err = os .Chdir (testDir )
46+ assert .NoError (t , err )
47+
48+ cmd := exec .Command ("plural" , "crypto" , "init" )
49+ cmdOutput , err := cmd .CombinedOutput ()
50+ assert .NoError (t , err )
51+ fmt .Println (string (cmdOutput ))
52+ cmd = exec .Command ("plural" , "crypto" , "unlock" )
53+ cmdOutput , err = cmd .CombinedOutput ()
54+ assert .NoError (t , err )
55+ fmt .Println (string (cmdOutput ))
56+ }
You can’t perform that action at this time.
0 commit comments