2017-04-12 08:27:57 -04:00
|
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
2016-04-27 05:26:45 -07:00
|
|
|
// See License.txt for license information.
|
|
|
|
|
|
|
|
|
|
package api
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"os/exec"
|
2017-09-15 17:40:37 +01:00
|
|
|
"strings"
|
2016-04-27 05:26:45 -07:00
|
|
|
"testing"
|
|
|
|
|
|
2017-09-06 23:05:10 -07:00
|
|
|
"github.com/mattermost/mattermost-server/app"
|
|
|
|
|
"github.com/mattermost/mattermost-server/model"
|
2016-04-27 05:26:45 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestCliVersion(t *testing.T) {
|
2017-05-25 11:01:53 -04:00
|
|
|
if testing.Short() {
|
|
|
|
|
t.SkipNow()
|
2016-04-27 05:26:45 -07:00
|
|
|
}
|
|
|
|
|
|
2017-09-06 23:42:54 -07:00
|
|
|
cmd := exec.Command("bash", "-c", `go run ../cmd/platform/*.go version`)
|
2016-04-27 05:26:45 -07:00
|
|
|
output, err := cmd.CombinedOutput()
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Log(string(output))
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestCliCreateTeam(t *testing.T) {
|
2017-05-25 11:01:53 -04:00
|
|
|
if testing.Short() {
|
|
|
|
|
t.SkipNow()
|
2016-04-27 05:26:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
th := Setup().InitSystemAdmin()
|
|
|
|
|
|
|
|
|
|
id := model.NewId()
|
|
|
|
|
name := "name" + id
|
2016-12-06 10:49:34 -05:00
|
|
|
displayName := "Name " + id
|
2016-04-27 05:26:45 -07:00
|
|
|
|
2017-09-06 23:42:54 -07:00
|
|
|
cmd := exec.Command("bash", "-c", `go run ../cmd/platform/*.go team create --name "`+name+`" --display_name "`+displayName+`"`)
|
2016-04-27 05:26:45 -07:00
|
|
|
output, err := cmd.CombinedOutput()
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Log(string(output))
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
found := th.SystemAdminClient.Must(th.SystemAdminClient.FindTeamByName(name)).Data.(bool)
|
|
|
|
|
|
|
|
|
|
if !found {
|
|
|
|
|
t.Fatal("Failed to create Team")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestCliCreateUserWithTeam(t *testing.T) {
|
2017-05-25 11:01:53 -04:00
|
|
|
if testing.Short() {
|
|
|
|
|
t.SkipNow()
|
2016-04-27 05:26:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
th := Setup().InitSystemAdmin()
|
|
|
|
|
|
|
|
|
|
id := model.NewId()
|
|
|
|
|
email := "success+" + id + "@simulator.amazonses.com"
|
|
|
|
|
username := "name" + id
|
|
|
|
|
|
2017-09-06 23:42:54 -07:00
|
|
|
cmd := exec.Command("bash", "-c", `go run ../cmd/platform/*.go user create --email "`+email+`" --password "mypassword1" --username "`+username+`"`)
|
2016-04-27 05:26:45 -07:00
|
|
|
output, err := cmd.CombinedOutput()
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Log(string(output))
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-06 23:42:54 -07:00
|
|
|
cmd2 := exec.Command("bash", "-c", `go run ../cmd/platform/*.go team add `+th.SystemAdminTeam.Id+" "+email)
|
2016-12-06 10:49:34 -05:00
|
|
|
output2, err2 := cmd2.CombinedOutput()
|
|
|
|
|
if err2 != nil {
|
|
|
|
|
t.Log(string(output2))
|
|
|
|
|
t.Fatal(err2)
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-19 14:49:25 -04:00
|
|
|
profiles := th.SystemAdminClient.Must(th.SystemAdminClient.GetProfilesInTeam(th.SystemAdminTeam.Id, 0, 1000, "")).Data.(map[string]*model.User)
|
2016-04-27 05:26:45 -07:00
|
|
|
|
|
|
|
|
found := false
|
|
|
|
|
|
|
|
|
|
for _, user := range profiles {
|
|
|
|
|
if user.Email == email {
|
|
|
|
|
found = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if !found {
|
|
|
|
|
t.Fatal("Failed to create User")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestCliCreateUserWithoutTeam(t *testing.T) {
|
2017-05-25 11:01:53 -04:00
|
|
|
if testing.Short() {
|
|
|
|
|
t.SkipNow()
|
2016-04-27 05:26:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Setup()
|
|
|
|
|
id := model.NewId()
|
|
|
|
|
email := "success+" + id + "@simulator.amazonses.com"
|
|
|
|
|
username := "name" + id
|
|
|
|
|
|
2017-09-06 23:42:54 -07:00
|
|
|
cmd := exec.Command("bash", "-c", `go run ../cmd/platform/*.go user create --email "`+email+`" --password "mypassword1" --username "`+username+`"`)
|
2016-04-27 05:26:45 -07:00
|
|
|
output, err := cmd.CombinedOutput()
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Log(string(output))
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-06 17:12:54 -05:00
|
|
|
if result := <-app.Global().Srv.Store.User().GetByEmail(email); result.Err != nil {
|
2016-04-27 05:26:45 -07:00
|
|
|
t.Fatal()
|
|
|
|
|
} else {
|
|
|
|
|
user := result.Data.(*model.User)
|
|
|
|
|
if user.Email != email {
|
|
|
|
|
t.Fatal()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestCliAssignRole(t *testing.T) {
|
2017-05-25 11:01:53 -04:00
|
|
|
if testing.Short() {
|
|
|
|
|
t.SkipNow()
|
2016-04-27 05:26:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
th := Setup().InitBasic()
|
|
|
|
|
|
2017-09-06 23:42:54 -07:00
|
|
|
cmd := exec.Command("bash", "-c", "go run ../cmd/platform/*.go roles system_admin "+th.BasicUser.Email)
|
2016-04-27 05:26:45 -07:00
|
|
|
output, err := cmd.CombinedOutput()
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Log(string(output))
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-06 17:12:54 -05:00
|
|
|
if result := <-th.App.Srv.Store.User().GetByEmail(th.BasicUser.Email); result.Err != nil {
|
2016-04-27 05:26:45 -07:00
|
|
|
t.Fatal()
|
|
|
|
|
} else {
|
|
|
|
|
user := result.Data.(*model.User)
|
2016-12-06 10:49:34 -05:00
|
|
|
if user.Roles != "system_admin system_user" {
|
2016-04-27 05:26:45 -07:00
|
|
|
t.Fatal()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-06 10:11:21 -08:00
|
|
|
func TestCliJoinChannel(t *testing.T) {
|
2017-05-25 11:01:53 -04:00
|
|
|
if testing.Short() {
|
|
|
|
|
t.SkipNow()
|
2016-07-06 10:11:21 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
th := Setup().InitBasic()
|
|
|
|
|
channel := th.CreateChannel(th.BasicClient, th.BasicTeam)
|
|
|
|
|
|
2017-09-15 17:40:37 +01:00
|
|
|
cmd := exec.Command("bash", "-c", "go run ../cmd/platform/*.go channel add "+th.BasicTeam.Name+":"+channel.Name+" "+th.BasicUser2.Email)
|
|
|
|
|
output, err := cmd.CombinedOutput()
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Log(string(output))
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
}
|
2016-07-06 10:11:21 -08:00
|
|
|
|
2017-09-15 17:40:37 +01:00
|
|
|
// Joining twice should succeed
|
|
|
|
|
cmd1 := exec.Command("bash", "-c", "go run ../cmd/platform/*.go channel add "+th.BasicTeam.Name+":"+channel.Name+" "+th.BasicUser2.Email)
|
|
|
|
|
output1, err1 := cmd1.CombinedOutput()
|
|
|
|
|
if err1 != nil {
|
|
|
|
|
t.Log(string(output1))
|
|
|
|
|
t.Fatal(err1)
|
|
|
|
|
}
|
2016-07-06 10:11:21 -08:00
|
|
|
|
|
|
|
|
// should fail because channel does not exist
|
2017-09-06 23:42:54 -07:00
|
|
|
cmd2 := exec.Command("bash", "-c", "go run ../cmd/platform/*.go channel add "+th.BasicTeam.Name+":"+channel.Name+"asdf "+th.BasicUser2.Email)
|
2016-07-06 10:11:21 -08:00
|
|
|
output2, err2 := cmd2.CombinedOutput()
|
|
|
|
|
if err2 == nil {
|
|
|
|
|
t.Log(string(output2))
|
|
|
|
|
t.Fatal()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestCliRemoveChannel(t *testing.T) {
|
2017-05-25 11:01:53 -04:00
|
|
|
if testing.Short() {
|
|
|
|
|
t.SkipNow()
|
2016-07-06 10:11:21 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
th := Setup().InitBasic()
|
|
|
|
|
channel := th.CreateChannel(th.BasicClient, th.BasicTeam)
|
|
|
|
|
|
2017-09-15 17:40:37 +01:00
|
|
|
cmd := exec.Command("bash", "-c", "go run ../cmd/platform/*.go channel add "+th.BasicTeam.Name+":"+channel.Name+" "+th.BasicUser2.Email)
|
|
|
|
|
output, err := cmd.CombinedOutput()
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Log(string(output))
|
|
|
|
|
t.Fatal(err)
|
2016-07-06 10:11:21 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// should fail because channel does not exist
|
2017-09-06 23:42:54 -07:00
|
|
|
cmd2 := exec.Command("bash", "-c", "go run ../cmd/platform/*.go channel remove "+th.BasicTeam.Name+":doesnotexist "+th.BasicUser2.Email)
|
2016-07-06 10:11:21 -08:00
|
|
|
output2, err2 := cmd2.CombinedOutput()
|
|
|
|
|
if err2 == nil {
|
|
|
|
|
t.Log(string(output2))
|
|
|
|
|
t.Fatal()
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-06 23:42:54 -07:00
|
|
|
cmd3 := exec.Command("bash", "-c", "go run ../cmd/platform/*.go channel remove "+th.BasicTeam.Name+":"+channel.Name+" "+th.BasicUser2.Email)
|
2016-07-06 10:11:21 -08:00
|
|
|
output3, err3 := cmd3.CombinedOutput()
|
2017-09-15 17:40:37 +01:00
|
|
|
if err3 != nil {
|
2016-07-06 10:11:21 -08:00
|
|
|
t.Log(string(output3))
|
2017-09-15 17:40:37 +01:00
|
|
|
t.Fatal(err3)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Leaving twice should succeed
|
|
|
|
|
cmd4 := exec.Command("bash", "-c", "go run ../cmd/platform/*.go channel remove "+th.BasicTeam.Name+":"+channel.Name+" "+th.BasicUser2.Email)
|
|
|
|
|
output4, err4 := cmd4.CombinedOutput()
|
|
|
|
|
if err4 != nil {
|
|
|
|
|
t.Log(string(output4))
|
|
|
|
|
t.Fatal(err4)
|
2016-07-06 10:11:21 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestCliListChannels(t *testing.T) {
|
2017-05-25 11:01:53 -04:00
|
|
|
if testing.Short() {
|
|
|
|
|
t.SkipNow()
|
2016-07-06 10:11:21 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
th := Setup().InitBasic()
|
|
|
|
|
channel := th.CreateChannel(th.BasicClient, th.BasicTeam)
|
|
|
|
|
th.BasicClient.Must(th.BasicClient.DeleteChannel(channel.Id))
|
|
|
|
|
|
2017-09-15 17:40:37 +01:00
|
|
|
cmd := exec.Command("bash", "-c", "go run ../cmd/platform/*.go channel list "+th.BasicTeam.Name)
|
|
|
|
|
output, err := cmd.CombinedOutput()
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Log(string(output))
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
}
|
2016-07-06 10:11:21 -08:00
|
|
|
|
2017-09-15 17:40:37 +01:00
|
|
|
if !strings.Contains(string(output), "town-square") {
|
|
|
|
|
t.Fatal("should have channels")
|
|
|
|
|
}
|
2016-07-06 10:11:21 -08:00
|
|
|
|
2017-09-15 17:40:37 +01:00
|
|
|
if !strings.Contains(string(output), channel.Name+" (archived)") {
|
|
|
|
|
t.Fatal("should have archived channel")
|
2016-07-06 10:11:21 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestCliRestoreChannel(t *testing.T) {
|
2017-05-25 11:01:53 -04:00
|
|
|
if testing.Short() {
|
|
|
|
|
t.SkipNow()
|
2016-07-06 10:11:21 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
th := Setup().InitBasic()
|
|
|
|
|
channel := th.CreateChannel(th.BasicClient, th.BasicTeam)
|
|
|
|
|
th.BasicClient.Must(th.BasicClient.DeleteChannel(channel.Id))
|
|
|
|
|
|
2017-09-15 17:40:37 +01:00
|
|
|
cmd := exec.Command("bash", "-c", "go run ../cmd/platform/*.go channel restore "+th.BasicTeam.Name+":"+channel.Name)
|
|
|
|
|
output, err := cmd.CombinedOutput()
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Log(string(output))
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// restoring twice should succeed
|
|
|
|
|
cmd1 := exec.Command("bash", "-c", "go run ../cmd/platform/*.go channel restore "+th.BasicTeam.Name+":"+channel.Name)
|
|
|
|
|
output1, err1 := cmd1.CombinedOutput()
|
|
|
|
|
if err1 != nil {
|
|
|
|
|
t.Log(string(output1))
|
|
|
|
|
t.Fatal(err1)
|
2016-07-06 10:11:21 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-27 05:26:45 -07:00
|
|
|
func TestCliJoinTeam(t *testing.T) {
|
2017-05-25 11:01:53 -04:00
|
|
|
if testing.Short() {
|
|
|
|
|
t.SkipNow()
|
2016-04-27 05:26:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
th := Setup().InitSystemAdmin().InitBasic()
|
|
|
|
|
|
2017-09-06 23:42:54 -07:00
|
|
|
cmd := exec.Command("bash", "-c", "go run ../cmd/platform/*.go team add "+th.SystemAdminTeam.Name+" "+th.BasicUser.Email)
|
2016-04-27 05:26:45 -07:00
|
|
|
output, err := cmd.CombinedOutput()
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Log(string(output))
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-19 14:49:25 -04:00
|
|
|
profiles := th.SystemAdminClient.Must(th.SystemAdminClient.GetProfilesInTeam(th.SystemAdminTeam.Id, 0, 1000, "")).Data.(map[string]*model.User)
|
2016-04-27 05:26:45 -07:00
|
|
|
|
|
|
|
|
found := false
|
|
|
|
|
|
|
|
|
|
for _, user := range profiles {
|
|
|
|
|
if user.Email == th.BasicUser.Email {
|
|
|
|
|
found = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if !found {
|
|
|
|
|
t.Fatal("Failed to create User")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-06 13:40:59 -08:00
|
|
|
func TestCliLeaveTeam(t *testing.T) {
|
2017-05-25 11:01:53 -04:00
|
|
|
if testing.Short() {
|
|
|
|
|
t.SkipNow()
|
2016-07-06 13:40:59 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
th := Setup().InitBasic()
|
|
|
|
|
|
2017-09-06 23:42:54 -07:00
|
|
|
cmd := exec.Command("bash", "-c", "go run ../cmd/platform/*.go team remove "+th.BasicTeam.Name+" "+th.BasicUser.Email)
|
2016-07-06 13:40:59 -08:00
|
|
|
output, err := cmd.CombinedOutput()
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Log(string(output))
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-19 14:49:25 -04:00
|
|
|
profiles := th.BasicClient.Must(th.BasicClient.GetProfilesInTeam(th.BasicTeam.Id, 0, 1000, "")).Data.(map[string]*model.User)
|
2016-07-06 13:40:59 -08:00
|
|
|
|
|
|
|
|
found := false
|
|
|
|
|
|
|
|
|
|
for _, user := range profiles {
|
|
|
|
|
if user.Email == th.BasicUser.Email {
|
|
|
|
|
found = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-19 14:49:25 -04:00
|
|
|
if found {
|
|
|
|
|
t.Fatal("profile should not be on team")
|
2016-07-06 13:40:59 -08:00
|
|
|
}
|
|
|
|
|
|
2017-09-06 17:12:54 -05:00
|
|
|
if result := <-th.App.Srv.Store.Team().GetTeamsByUserId(th.BasicUser.Id); result.Err != nil {
|
2016-07-06 13:40:59 -08:00
|
|
|
teamMembers := result.Data.([]*model.TeamMember)
|
|
|
|
|
if len(teamMembers) > 0 {
|
|
|
|
|
t.Fatal("Shouldn't be in team")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-27 05:26:45 -07:00
|
|
|
func TestCliResetPassword(t *testing.T) {
|
2017-05-25 11:01:53 -04:00
|
|
|
if testing.Short() {
|
|
|
|
|
t.SkipNow()
|
2016-04-27 05:26:45 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
th := Setup().InitBasic()
|
|
|
|
|
|
2017-09-06 23:42:54 -07:00
|
|
|
cmd := exec.Command("bash", "-c", "go run ../cmd/platform/*.go user password "+th.BasicUser.Email+" password2")
|
2016-04-27 05:26:45 -07:00
|
|
|
output, err := cmd.CombinedOutput()
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Log(string(output))
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
th.BasicClient.Logout()
|
|
|
|
|
th.BasicUser.Password = "password2"
|
|
|
|
|
th.LoginBasic()
|
|
|
|
|
}
|
2016-08-12 06:50:11 -05:00
|
|
|
|
|
|
|
|
func TestCliCreateChannel(t *testing.T) {
|
2017-05-25 11:01:53 -04:00
|
|
|
if testing.Short() {
|
|
|
|
|
t.SkipNow()
|
2016-08-12 06:50:11 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
th := Setup().InitBasic()
|
|
|
|
|
|
|
|
|
|
id := model.NewId()
|
|
|
|
|
name := "name" + id
|
|
|
|
|
|
2017-09-06 23:42:54 -07:00
|
|
|
cmd := exec.Command("bash", "-c", "go run ../cmd/platform/*.go channel create --display_name "+name+" --team "+th.BasicTeam.Name+" --name "+name)
|
2016-08-12 06:50:11 -05:00
|
|
|
output, err := cmd.CombinedOutput()
|
2017-09-15 17:40:37 +01:00
|
|
|
if err != nil {
|
2016-08-12 06:50:11 -05:00
|
|
|
t.Log(string(output))
|
2017-09-15 17:40:37 +01:00
|
|
|
t.Fatal(err)
|
2016-08-12 06:50:11 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
name = name + "-private"
|
2017-09-06 23:42:54 -07:00
|
|
|
cmd2 := exec.Command("bash", "-c", "go run ../cmd/platform/*.go channel create --display_name="+name+" --team "+th.BasicTeam.Name+" --private --name "+name)
|
2016-08-12 06:50:11 -05:00
|
|
|
output2, err2 := cmd2.CombinedOutput()
|
2017-09-15 17:40:37 +01:00
|
|
|
if err2 != nil {
|
2016-08-12 06:50:11 -05:00
|
|
|
t.Log(string(output2))
|
2017-09-15 17:40:37 +01:00
|
|
|
t.Fatal(err2)
|
2016-08-12 06:50:11 -05:00
|
|
|
}
|
|
|
|
|
}
|
2016-09-15 12:33:16 -03:00
|
|
|
|
|
|
|
|
func TestCliMakeUserActiveAndInactive(t *testing.T) {
|
2017-05-25 11:01:53 -04:00
|
|
|
if testing.Short() {
|
|
|
|
|
t.SkipNow()
|
2016-09-15 12:33:16 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
th := Setup().InitBasic()
|
|
|
|
|
|
|
|
|
|
// first inactivate the user
|
2017-09-06 23:42:54 -07:00
|
|
|
cmd := exec.Command("bash", "-c", "go run ../cmd/platform/*.go user deactivate "+th.BasicUser.Email)
|
2016-09-15 12:33:16 -03:00
|
|
|
output, err := cmd.CombinedOutput()
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Log(string(output))
|
|
|
|
|
t.Fatal()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// activate the inactive user
|
2017-09-06 23:42:54 -07:00
|
|
|
cmd2 := exec.Command("bash", "-c", "go run ../cmd/platform/*.go user activate "+th.BasicUser.Email)
|
2016-09-15 12:33:16 -03:00
|
|
|
output2, err2 := cmd2.CombinedOutput()
|
|
|
|
|
if err2 != nil {
|
|
|
|
|
t.Log(string(output2))
|
|
|
|
|
t.Fatal()
|
|
|
|
|
}
|
|
|
|
|
}
|