Commit 53260ec4 authored by Eric Cano's avatar Eric Cano
Browse files

Moved the tape server's files into castor-style names.

parent da1fbc3f
This project has been actively developed by (ordered by first contribution): The tape server has been actively developed by (ordered by first contribution):
Eric Cano <Eric.Cano@cern.ch> Eric Cano <Eric.Cano@cern.ch>
Daniele Francesco Kruse <daniele.francesco.kruse@cern.ch> Daniele Francesco Kruse <daniele.francesco.kruse@cern.ch>
Victor Kotlyar' <Victor.Kotlyar@ihep.ru> Victor Kotlyar' <Victor.Kotlyar@ihep.ru>
\ No newline at end of file Steven Murray <Steven.Murray@cern.ch>
\ No newline at end of file
add_executable(tapeserverd tapeserverd.cc) add_executable(tapeserverd tapeserverd.cpp)
target_link_libraries(tapeserverd Exception SCSI System Utils File) target_link_libraries(tapeserverd Exception SCSI System Utils File)
\ No newline at end of file
// ---------------------------------------------------------------------- /******************************************************************************
// File: Daemon/tapeserverd.cc * tapeserverd.cpp
// ---------------------------------------------------------------------- *
* This file is part of the Castor project.
/************************************************************************ * See http://castor.web.cern.ch/castor
* Tape Server * *
* Copyright (C) 2013 CERN/Switzerland * * Copyright (C) 2003 CERN
* * * This program is free software; you can redistribute it and/or
* This program is free software: you can redistribute it and/or modify * * modify it under the terms of the GNU General Public License
* it under the terms of the GNU General Public License as published by * * as published by the Free Software Foundation; either version 2
* the Free Software Foundation, either version 3 of the License, or * * of the License, or (at your option) any later version.
* (at your option) any later version. * * This program is distributed in the hope that it will be useful,
* * * but WITHOUT ANY WARRANTY; without even the implied warranty of
* This program is distributed in the hope that it will be useful, * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * GNU General Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * You should have received a copy of the GNU General Public License
* GNU General Public License for more details. * * along with this program; if not, write to the Free Software
* * * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* You should have received a copy of the GNU General Public License * *
* along with this program. If not, see <http://www.gnu.org/licenses/>.* *
************************************************************************/ *
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#include <iostream> #include <iostream>
#include <exception> #include <exception>
...@@ -29,7 +31,7 @@ ...@@ -29,7 +31,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sstream> #include <sstream>
#include "tapeserverd.hh" #include "tapeserverd.hpp"
int main(int argc, char ** argv) { int main(int argc, char ** argv) {
try { try {
......
// ---------------------------------------------------------------------- /******************************************************************************
// File: Daemon/tapeserverd.hh * tapeserverd.hpp
// ---------------------------------------------------------------------- *
* This file is part of the Castor project.
/************************************************************************ * See http://castor.web.cern.ch/castor
* Tape Server * *
* Copyright (C) 2013 CERN/Switzerland * * Copyright (C) 2003 CERN
* * * This program is free software; you can redistribute it and/or
* This program is free software: you can redistribute it and/or modify * * modify it under the terms of the GNU General Public License
* it under the terms of the GNU General Public License as published by * * as published by the Free Software Foundation; either version 2
* the Free Software Foundation, either version 3 of the License, or * * of the License, or (at your option) any later version.
* (at your option) any later version. * * This program is distributed in the hope that it will be useful,
* * * but WITHOUT ANY WARRANTY; without even the implied warranty of
* This program is distributed in the hope that it will be useful, * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * GNU General Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * You should have received a copy of the GNU General Public License
* GNU General Public License for more details. * * along with this program; if not, write to the Free Software
* * * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* You should have received a copy of the GNU General Public License * *
* along with this program. If not, see <http://www.gnu.org/licenses/>.* *
************************************************************************/ *
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#pragma once #pragma once
#include "../Exception/Exception.hh" #include "../Exception/Exception.hpp"
namespace Tape { namespace Tape {
namespace Server { namespace Server {
......
add_library(TapeDrive Drive.cc) add_library(TapeDrive Drive.cpp)
set_property(SOURCE Drive.cc set_property(SOURCE Drive.cpp
PROPERTY COMPILE_FLAGS -fno-strict-aliasing PROPERTY COMPILE_FLAGS -fno-strict-aliasing
) )
add_executable(TapeDriveReadWriteTest TapeDriveReadWriteTest.cc) add_executable(TapeDriveReadWriteTest TapeDriveReadWriteTest.cpp)
target_link_libraries(TapeDriveReadWriteTest TapeDrive Exception SCSI System Utils ${GTEST_LIBRARY} gmock pthread) target_link_libraries(TapeDriveReadWriteTest TapeDrive Exception SCSI System Utils ${GTEST_LIBRARY} gmock pthread)
install(TARGETS TapeDriveReadWriteTest install(TARGETS TapeDriveReadWriteTest
......
// ---------------------------------------------------------------------- /******************************************************************************
// File: Drive/Drive.cc * Drive.cpp
// ---------------------------------------------------------------------- *
* This file is part of the Castor project.
/************************************************************************ * See http://castor.web.cern.ch/castor
* Tape Server * *
* Copyright (C) 2013 CERN/Switzerland * * Copyright (C) 2003 CERN
* * * This program is free software; you can redistribute it and/or
* This program is free software: you can redistribute it and/or modify * * modify it under the terms of the GNU General Public License
* it under the terms of the GNU General Public License as published by * * as published by the Free Software Foundation; either version 2
* the Free Software Foundation, either version 3 of the License, or * * of the License, or (at your option) any later version.
* (at your option) any later version. * * This program is distributed in the hope that it will be useful,
* * * but WITHOUT ANY WARRANTY; without even the implied warranty of
* This program is distributed in the hope that it will be useful, * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * GNU General Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * You should have received a copy of the GNU General Public License
* GNU General Public License for more details. * * along with this program; if not, write to the Free Software
* * * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* You should have received a copy of the GNU General Public License * *
* along with this program. If not, see <http://www.gnu.org/licenses/>.* *
************************************************************************/ *
* @author Castor Dev team, castor-dev@cern.ch
#include "Drive.hh" *****************************************************************************/
#include "Drive.hpp"
Tape::DriveGeneric::DriveGeneric(SCSI::DeviceInfo di, System::virtualWrapper& sw) : m_SCSIInfo(di), Tape::DriveGeneric::DriveGeneric(SCSI::DeviceInfo di, System::virtualWrapper& sw) : m_SCSIInfo(di),
m_tapeFD(-1), m_sysWrapper(sw) { m_tapeFD(-1), m_sysWrapper(sw) {
......
// ---------------------------------------------------------------------- /******************************************************************************
// File: Drive/Drive.hh * Drive.hpp
// ---------------------------------------------------------------------- *
* This file is part of the Castor project.
/************************************************************************ * See http://castor.web.cern.ch/castor
* Tape Server * *
* Copyright (C) 2013 CERN/Switzerland * * Copyright (C) 2003 CERN
* * * This program is free software; you can redistribute it and/or
* This program is free software: you can redistribute it and/or modify * * modify it under the terms of the GNU General Public License
* it under the terms of the GNU General Public License as published by * * as published by the Free Software Foundation; either version 2
* the Free Software Foundation, either version 3 of the License, or * * of the License, or (at your option) any later version.
* (at your option) any later version. * * This program is distributed in the hope that it will be useful,
* * * but WITHOUT ANY WARRANTY; without even the implied warranty of
* This program is distributed in the hope that it will be useful, * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * GNU General Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * You should have received a copy of the GNU General Public License
* GNU General Public License for more details. * * along with this program; if not, write to the Free Software
* * * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* You should have received a copy of the GNU General Public License * *
* along with this program. If not, see <http://www.gnu.org/licenses/>.* *
************************************************************************/ *
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#pragma once #pragma once
#include "../SCSI/Device.hh" #include "../SCSI/Device.hpp"
#include "../SCSI/Structures.hh" #include "../SCSI/Structures.hpp"
#include "../SCSI/Exception.hh" #include "../SCSI/Exception.hpp"
#include "../System/Wrapper.hh" #include "../System/Wrapper.hpp"
#include "../Exception/Exception.hh" #include "../Exception/Exception.hpp"
#include "mtio_add.hh" #include "mtio_add.hpp"
/** /**
* Class wrapping the tape server. Has to be templated (and hence fully in .hh) * Class wrapping the tape server. Has to be templated (and hence fully in .hh)
......
// ---------------------------------------------------------------------- /******************************************************************************
// File: SCSI/DriveTest.cc * DriveTest.cpp
// ---------------------------------------------------------------------- *
* This file is part of the Castor project.
/************************************************************************ * See http://castor.web.cern.ch/castor
* Tape Server * *
* Copyright (C) 2013 CERN/Switzerland * * Copyright (C) 2003 CERN
* * * This program is free software; you can redistribute it and/or
* This program is free software: you can redistribute it and/or modify * * modify it under the terms of the GNU General Public License
* it under the terms of the GNU General Public License as published by * * as published by the Free Software Foundation; either version 2
* the Free Software Foundation, either version 3 of the License, or * * of the License, or (at your option) any later version.
* (at your option) any later version. * * This program is distributed in the hope that it will be useful,
* * * but WITHOUT ANY WARRANTY; without even the implied warranty of
* This program is distributed in the hope that it will be useful, * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * GNU General Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * You should have received a copy of the GNU General Public License
* GNU General Public License for more details. * * along with this program; if not, write to the Free Software
* * * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* You should have received a copy of the GNU General Public License * *
* along with this program. If not, see <http://www.gnu.org/licenses/>.* *
************************************************************************/ *
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <gmock/gmock-cardinalities.h> #include <gmock/gmock-cardinalities.h>
#include "../SCSI/Device.hh" #include "../SCSI/Device.hpp"
#include "../System/Wrapper.hh" #include "../System/Wrapper.hpp"
#include "Drive.hh" #include "Drive.hpp"
using ::testing::AtLeast; using ::testing::AtLeast;
using ::testing::Return; using ::testing::Return;
......
// ---------------------------------------------------------------------- /******************************************************************************
// File: SCSI/TapeDriveInfo.cc * TapeDriveReadWriteTest.cpp
// ---------------------------------------------------------------------- *
* This file is part of the Castor project.
/************************************************************************ * See http://castor.web.cern.ch/castor
* Tape Server * *
* Copyright (C) 2013 CERN/Switzerland * * Copyright (C) 2003 CERN
* * * This program is free software; you can redistribute it and/or
* This program is free software: you can redistribute it and/or modify * * modify it under the terms of the GNU General Public License
* it under the terms of the GNU General Public License as published by * * as published by the Free Software Foundation; either version 2
* the Free Software Foundation, either version 3 of the License, or * * of the License, or (at your option) any later version.
* (at your option) any later version. * * This program is distributed in the hope that it will be useful,
* * * but WITHOUT ANY WARRANTY; without even the implied warranty of
* This program is distributed in the hope that it will be useful, * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * GNU General Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * You should have received a copy of the GNU General Public License
* GNU General Public License for more details. * * along with this program; if not, write to the Free Software
* * * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* You should have received a copy of the GNU General Public License * *
* along with this program. If not, see <http://www.gnu.org/licenses/>.* *
************************************************************************/ *
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
/** /**
* Test main program. For development use. * Test main program. For development use.
*/ */
#include "../System/Wrapper.hh" #include "../System/Wrapper.hpp"
#include "../SCSI/Device.hh" #include "../SCSI/Device.hpp"
#include "Drive.hh" #include "Drive.hpp"
#include <iostream> #include <iostream>
#include <assert.h> #include <assert.h>
......
add_library(Exception Exception.cc) add_library(Exception Exception.cpp)
// ---------------------------------------------------------------------- /******************************************************************************
// File: Exception/Exception.cc * Exception.cpp
// ---------------------------------------------------------------------- *
* This file is part of the Castor project.
* See http://castor.web.cern.ch/castor
*
* Copyright (C) 2003 CERN
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
*
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
/************************************************************************
* Tape Server *
* Copyright (C) 2013 CERN/Switzerland *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>.*
************************************************************************/
#define _XOPEN_SOURCE 600 #define _XOPEN_SOURCE 600
#include "Exception.hh" #include "Exception.hpp"
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
/* We want the thread safe (and portable) version of strerror */ /* We want the thread safe (and portable) version of strerror */
......
// ---------------------------------------------------------------------- /******************************************************************************
// File: Exception/Exception.hh * Exception.hpp
// ---------------------------------------------------------------------- *
* This file is part of the Castor project.
/************************************************************************ * See http://castor.web.cern.ch/castor
* Tape Server * *
* Copyright (C) 2013 CERN/Switzerland * * Copyright (C) 2003 CERN
* * * This program is free software; you can redistribute it and/or
* This program is free software: you can redistribute it and/or modify * * modify it under the terms of the GNU General Public License
* it under the terms of the GNU General Public License as published by * * as published by the Free Software Foundation; either version 2
* the Free Software Foundation, either version 3 of the License, or * * of the License, or (at your option) any later version.
* (at your option) any later version. * * This program is distributed in the hope that it will be useful,
* * * but WITHOUT ANY WARRANTY; without even the implied warranty of
* This program is distributed in the hope that it will be useful, * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * GNU General Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * You should have received a copy of the GNU General Public License
* GNU General Public License for more details. * * along with this program; if not, write to the Free Software
* * * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* You should have received a copy of the GNU General Public License * *
* along with this program. If not, see <http://www.gnu.org/licenses/>.* *
************************************************************************/ *
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#pragma once #pragma once
#include <exception> #include <exception>
......
// ---------------------------------------------------------------------- /******************************************************************************
// File: Exception/ExceptionTest.cc * ExceptionTest.cpp
// ---------------------------------------------------------------------- *
* This file is part of the Castor project.
* See http://castor.web.cern.ch/castor
*
* Copyright (C) 2003 CERN
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
*
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
/************************************************************************ #include "Exception.hpp"
* Tape Server *
* Copyright (C) 2013 CERN/Switzerland *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>.*
************************************************************************/
#include "Exception.hh"
#include <errno.h> #include <errno.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
......
add_library(File Structures.cc) add_library(File Structures.cpp)
// ---------------------------------------------------------------------- /******************************************************************************
// File: File/File.hh * File.hpp
// ---------------------------------------------------------------------- *
* This file is part of the Castor project.
/************************************************************************ * See http://castor.web.cern.ch/castor
* Tape Server * *
* Copyright (C) 2013 CERN/Switzerland * * Copyright (C) 2003 CERN
* * * This program is free software; you can redistribute it and/or
* This program is free software: you can redistribute it and/or modify * * modify it under the terms of the GNU General Public License
* it under the terms of the GNU General Public License as published by * * as published by the Free Software Foundation; either version 2
* the Free Software Foundation, either version 3 of the License, or * * of the License, or (at your option) any later version.
* (at your option) any later version. * * This program is distributed in the hope that it will be useful,
* * * but WITHOUT ANY WARRANTY; without even the implied warranty of
* This program is distributed in the hope that it will be useful, * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * GNU General Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * You should have received a copy of the GNU General Public License
* GNU General Public License for more details. * * along with this program; if not, write to the Free Software
* * * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* You should have received a copy of the GNU General Public License * *
* along with this program. If not, see <http://www.gnu.org/licenses/>.* *
************************************************************************/ *
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#pragma once #pragma once
#include <string> #include <string>
#include "Structures.hh" #include "Structures.hpp"
namespace Tape { namespace Tape {
/** /**
......
// ---------------------------------------------------------------------- /******************************************************************************
// File: File/Structures.cc * Structures.cpp
// ---------------------------------------------------------------------- *
*