Skip to content

Commit

Permalink
fixed ticket SysFera#399: renamed vishn_more to vishnu_cat
Browse files Browse the repository at this point in the history
  • Loading branch information
R. Chakode authored and kcoulomb committed Mar 26, 2014
1 parent e6d615c commit c5484c3
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion FMS/src/api/api_fms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ throw (UMSVishnuException, FMSVishnuException,
* \return 0 if everything is OK, another value otherwise
*/
int
vishnu::more(const string& sessionKey, const string& path,
vishnu::cat(const string& sessionKey, const string& path,
string& contentOfFile)
throw (UMSVishnuException, FMSVishnuException,
UserException, SystemException) {
Expand Down
2 changes: 1 addition & 1 deletion FMS/src/api/api_fms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ int acp(const std::string& sessionKey,const std::string& src, const std::string&
* \param contentOfFile the content of specified the file
* \return 0 if everything is OK, another value otherwise
*/
int more(const std::string& sessionKey,const std::string& path, std::string& contentOfFile)
int cat(const std::string& sessionKey,const std::string& path, std::string& contentOfFile)
throw (UMSVishnuException, FMSVishnuException, UserException, SystemException);


Expand Down
2 changes: 1 addition & 1 deletion FMS/src/cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ set(ALLCLI
rmdir
chgrp
chmod
more
cat
ls
cp
acp
Expand Down
4 changes: 2 additions & 2 deletions FMS/src/cli/more.cpp → FMS/src/cli/cat.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* \file more.cpp
* \file cat.cpp
* This file defines the VISHNU content of file command
* \author Ibrahima Cisse ([email protected])
*/
Expand Down Expand Up @@ -31,7 +31,7 @@ struct ContentOfFileFunc {
int operator()(std::string sessionKey) {
string mfileContent;

int res = more(sessionKey, mpath, mfileContent);
int res = cat(sessionKey, mpath, mfileContent);
cout << mfileContent;
return res;
}
Expand Down
12 changes: 6 additions & 6 deletions FMS/test/src/fms_automTest5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ BOOST_AUTO_TEST_CASE(ContentOfFile_Base)
// Create a file 1Mb
createFile<1000>(localFilePath);
// Copy file on remote host
BOOST_MESSAGE( "REMOTE PATH: " + fileFullPath1 );
BOOST_REQUIRE( cp(sessionKey, localFilePath, fileFullPath1) == 0);
BOOST_MESSAGE("REMOTE PATH: " + fileFullPath1 );
BOOST_REQUIRE(cp(sessionKey, localFilePath, fileFullPath1) == 0);
string content;
BOOST_REQUIRE( more(sessionKey, fileFullPath1, content) == 0);
BOOST_REQUIRE(cat(sessionKey, fileFullPath1, content) == 0);
// To check the success of more function
BOOST_CHECK( content.substr(8,8) == "abcdefgh" );
// Cleanup
Expand Down Expand Up @@ -94,15 +94,15 @@ BOOST_AUTO_TEST_CASE(ContentOfFile_Exceptions)
// E1 case
string invalidDir = "rkvh";
string invalidFullPath = baseDirFullPath1 + slash + invalidDir + slash + newFileName;
BOOST_CHECK_THROW( more(sessionKey, invalidFullPath, content), VishnuException);
BOOST_CHECK_THROW( cat(sessionKey, invalidFullPath, content), VishnuException);
// E2 case
string noAccessLocalPath = "/root/abc";
string noAccessFullPath = m_test_fms_host1 + sep + noAccessLocalPath;
BOOST_CHECK_THROW( more(sessionKey, noAccessFullPath, content), VishnuException);
BOOST_CHECK_THROW( cat(sessionKey, noAccessFullPath, content), VishnuException);
// E3 case
string invalidMachineId = "tt";
string invalidMachineFullPath = invalidMachineId + sep + m_test_fms_dir1;
BOOST_CHECK_THROW( more(sessionKey, invalidMachineFullPath, content), VishnuException);
BOOST_CHECK_THROW( cat(sessionKey, invalidMachineFullPath, content), VishnuException);

} catch (VishnuException& e) {
BOOST_MESSAGE(e.what());
Expand Down
2 changes: 1 addition & 1 deletion core/model/FMS.apim
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<details key="description" value="Displays the last lines of a file at the location given by the path parameter.&#xA;The path must be provided in the form 'machine_id:path' (the machine_id&#xA;values can be obtained using the vishnu_list_machine command).&#xA;"/>
<details key="exCLI" value="To vizualize the 3 last lines of the file toto on machine_1:&#xA;vishnu_tail -n 3 machine_1:/tmp/toto"/>
</services>
<services name="more" description="displays content of files located on remote machines" resultCodes="ERRCODE_CONFIGNOTFOUND ERRCODE_DBERR ERRCODE_DIET ERRCODE_INVALID_PARAM ERRCODE_INVALID_PATH ERRCODE_NO_ADMIN ERRCODE_RUNTIME_ERROR ERRCODE_SESSIONKEY_EXPIRED ERRCODE_SESSIONKEY_NOT_FOUND ERRCODE_UNDEFINED ERRCODE_UNKNOWN_FILE_TRANSFER ERRCODE_UNKNOWN_LOCAL_ACCOUNT ERRCODE_UNKNOWN_MACHINE VISHNU_OK">
<services name="cat" description="displays content of files located on remote machines" resultCodes="ERRCODE_CONFIGNOTFOUND ERRCODE_DBERR ERRCODE_DIET ERRCODE_INVALID_PARAM ERRCODE_INVALID_PATH ERRCODE_NO_ADMIN ERRCODE_RUNTIME_ERROR ERRCODE_SESSIONKEY_EXPIRED ERRCODE_SESSIONKEY_NOT_FOUND ERRCODE_UNDEFINED ERRCODE_UNKNOWN_FILE_TRANSFER ERRCODE_UNKNOWN_LOCAL_ACCOUNT ERRCODE_UNKNOWN_MACHINE VISHNU_OK">
<ports name="sessionKey" usage="API_ONLY" dataType="//@modules.0/@typeList/@types.0" description="The session key"/>
<ports name="path" dataType="//@modules.0/@typeList/@types.0" description="The file to display following the pattern [host:]file path" longOptionName=""/>
<ports name="fileContent" direction="OUT" dataType="//@modules.0/@typeList/@types.0" description="The content of the file" longOptionName=""/>
Expand Down

0 comments on commit c5484c3

Please sign in to comment.